Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2320
CSOM get selected row count
posted

In our client side code, we have a function that uses

 igtbl_getLength(grid.SelectedRows);

to get the selected row count.  This works perfectly except when the user also has the filter row selected.  The count is then 1 off.  So if only 1 row is actually selected (beside the filter row) it says 2 rows are selected.  Is there anyway to get the filter row to check if it is selected so I can then decrement the count? 

Parents
  • 45049
    Verified Answer
    posted

    Here's the JavaScript I would use.  Please note that I haven't tested this, since I'm going primarily between memory and documentation.

    var selectedRowCount = igtbl_getLength(grid.SelectedRows);
    var filterRow = grid.Rows.getFilterRow();

    if (filterRow.getSelected())
        selectedRowCount = selectedRowCount - 1;

Reply Children
No Data