Problem with looping through grid rows in Javascript.
Posted: Mon Apr 16, 2018 12:17 pm
I'm trying to loop through a grid and setting on a checkbox based upon a value in a checkbox in the header. Here is my code:
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?
Code: Select all
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"));
}
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?