I have written a javascript function which calculates the hours from rows in a web grid depending on the check box checked in the grid. This worked perfectly until I added a pager, which causes there to be less rows on the page than the page size states.If the Pager is set to 20 rows per page and if there are total 100 rows in the grid; its getting only 20 rows. Is there anyway of accessing all rows in a grid (client-side) when a pager is in place ? Any suggestions will be appreciated, thank you!
function Grid_AfterBeforeCellUpdateHandler(gridName, cellId)
{
oGridName = gridName;
var total = 0;
var grid = igtbl_getGridById(oGridName);
var rid = 0;
var row = grid.Rows.getRow(rid++);
//loop thru' each row
while(row)
var selectedcell = row.getCellFromKey('ShiftHour');
var hours = selectedcell.getValue();
total += parseFloat(hours);
}
row = grid.Rows.getRow(rid++);
Hi,
If you have paging enabled, the rows are are not downloaded to the client at all. When you click on another page, you're doing a postback to retrieve the next page. Maybe you can get server side the total hours of checked rows of all the other pages before this page loads and then you can do the figuring for each page client side. This would only work if no one else is using the system at the same time. Also sounds kind of hard to implement.
Ed