debugger;
var myGrid = getObj('Grid1');
var myRows = myGrid.grid.getRecordCount();
//alert(myRows);
for (var x = 1;x <= myRows; x++) {
var cbSelect = 'cbSel.';
var cbObj = cbSelect + x;
changeElementValue(cbObj,get("cbSelAll"));
}
cbSel is a checkbox in the grid. cbSelAll is a checkbox on the header.
The issue is that it only changes the values on the displayed rows. The others are left unchanged. I can watch it loop through the rows in the debugger in Chrome. Still, the others are not changed. Any Ideas?
For performance reasons, the HTML elements for a grid are not created until you page the element onto the screen. Prior to that, the data is saved (under the covers) inside an array that we call the "data array". Unlike the get() API, the data array uses the BOUND field name (not the widget id) so you'll need to know which field is bound to the checkbox.