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
20
Getting rows data as JSON from selection across multiple pages in igGrid
posted

I am using igGrid with paging turned on and loading data through ajax call. Multiple rows are selected using checkbox and the selection spans multiple pages. The selection is being returned properly through the igGrid javascript selection api using
gridObject.igGrid("selectedRows")
I am able to get the row's index property to get the json row data from
$('#grid1').data('igGrid').dataSource.dataView()[indx];

However since paging is remote, the datasource dataview only contains the current page row data. Any selected row object from other pages has a rowIndex of -1 and the dataview cannot be used to get the json row data. This data is required to perform a few web service calls.

I would like to avoid caching the row data on every gridRowSelectionChanged event into a json array if possible. What is the recommended way to implement this in a simple manner?

Thanks,
Surya Pramanik

Parents
No Data
Reply
  • 5513
    Offline posted

    Hello Surya,

    There is no built-in functionality to automate this. However, Selection stores and returns the PK for every selected record. It is available in the collection returned by 'selectedRows' API call. Even if your web methods expect the whole record, it should be an easy change to allow them to accept PKs and select the model entities with them.

    I hope this helps! Please, let me know if you have any other questions or concerns!

    Best regards,

    Stamen Stoychev

Children
No Data