I am looking for a quick way to select all rows on the client. I am using the following function and it seems very slow.
function checkAll() { var grid = $find("WebDataGrid1"); var rows = grid.get_rows(); var selection = grid.get_behaviors().get_selection(); var selectedRows = selection.get_selectedRows(); var rowCount = rows.get_length();
grid.beginUpdate(); for (var i = 0; i < rowCount; i++) { var row = rows.get_row(i); selectedRows.add(row); } grid.endUpdate(); }
Any help would be greatly appreciated.
Which browser it is used in and how many rows are in the grid? Thanks.
IE 8 in IE 7 compatibility mode, 321 rows of two column data with one column hidden.
To add to the confusion the grid selection is actually faster in compatibility mode.
Tried Chrome works great. Tried pure IE8 same slowness as IE7. The weird thing is that de-selecting is very fast.
IE 8 (especially in IE7 compat mode) as very slow when it comes to dynamically setting the class attributes on a table's elements.
Try these browsers for comparison: Pure IE 8, IE 7 (not ie8 compat), Firefox, Chrome.