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
495
How to get list of data when clicking on the header of a column ?
posted

Brief summary; when a user clicks on a header to sort the column, I want to capture this event and get a list of the data AFTER the sorting has been applied.

One of the columns in my grid contains a unique id and I always want to get a list of those ID's after the sorting is applied...

  • 2745
    Verified Answer
    Offline posted

    You can try this:

    $(".selector").on("iggridsortingcolumnsorted", function (e, ui) {
        var data = $(".selector").data("igGrid").dataSource.dataView(); // To get records on the current page
        // var data = $(".selector").data("igGrid").dataSource.data(); // To get all records across all pages
    });

    Where ".selector" is the id of your grid.

    If paging is enabled, this will give you the sorted dataset of your current page.
    if paging is disabled, this will give you the entire sorted dataset.

    Referenced API:  http://help.infragistics.com/jQuery/2013.2/ui.iggridsorting