angularjsinfragisticsiggrid

IgGrid: Get all selected rows on grid using paging


I am trying to get all selected rows from a igGrid which uses paging. The problem is that when I use the code below, then I get only the selected rows of the current page (DOM). The selected rows from the other pages are not returned.

Is there a way to get all selected rows for every page?

Below is the code where I get the selected rows.

function getGridSelectedRowIds(GridId) {

     //Here I get only the selected rows of the current page
     var selectedRows = $("#" + GridId).igGrid("selectedRows");
     $scope.totalSelectedRowsIds = [];
     _.each(selectedRows, function (row) {
         $scope.totalSelectedRowsIds.push(row.id);
     });

}

Solution

  • You didn't provide you're grid code or IgniteUI version, but here is an working fiddle for you.

    Enable Selection grid feature

    {name: "Selection", multipleSelection:true}
    

    and this works fine

    $("#grid").igGridSelection("selectedRows");