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
140
Getting the Selected Rows in the sorted order as it appearing in the grid
posted

I am using iggrid 2012.2. I want to get  the Selected Rows in the sorted order of the grid. I am using the below API to get the selected rows, But the returned rows are not in the sorted order of the grid. It is in the order in which the row selector check boxes are checked by the user

var rows = $("#grid1").igGridSelection("selectedRows");   


Is there a way to get the selected rows in the sorted order as it appearing in the  grid? Please help

 

Thanks In Advance,

Benny

Parents
No Data
Reply
  • 5513
    Suggested Answer
    Offline posted

    Hello Benny,

    The selectedRows method will always return the rows in the order they were selected. To get them in the order they appear in the DOM, you could either select them with a jQuery selector, or sort the array returned by selectedRows manually. For the first approach all selected rows can be obtained with the following:

    $(".ui-iggrid-selectedcell").parent("tr");

    Their row id-s are stored in the data-id attribute so for example you can get the first row's id with:

    $(".ui-iggrid-selectedcell").parent("tr").first().attr("data-id");

    I hope this helps! Thank you for using Infragistics forums!

    Best regards,

    Stamen Stoychev

Children