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
625
get allRows by disabling paging
posted

Hi,

I have tried to get all rows by disabling paging, something like this:

$("#igGrid1").igGridPaging('destroy');         //disable paging

 var rows = $("#igGrid1").igGrid('allRows'); //get all rows

$("#igGrid1").igGridPaging('option', 'type', 'local'); //enable paging back

$("#igGrid1").igGridPaging('option', 'pageSize', 20);

but it doesn't work. Please can you provide me with an example of how it should be done?

Parents
No Data
Reply
  • 23953
    Suggested Answer
    Offline posted

     

    Hello IccAppSupport,

    As far as I know you cannot recreate igGridPaging. You should recreate the igGrid.

    Based on your scenario you can do one of the following:

    1. Get the data from the igGrid data source

    If your data source is local (For example: JavaScript object array) you can access the data collection directly by getting the dataSource property of the igGrid like this:

    var ds = $("#dataGrid").igGrid("option", "dataSource");

     

    If you data source is remote then you can use ajax call and get all the data from there.

     

    2. Recreate the grid and get the data from it

    If you want to show the grid without paging then you should recreate the grid itself like this:

    function recreateGrid() {

    // destroy the grid

    $("#igGrid1").igGrid('destroy');

    // recreate the grid without paging

    $("#dataGrid").igGrid({

    autoGenerateColumns: false,

    defaultColumnWidth: "100px",

    columns: [

     { headerText: "Item", key: "ProductID", dataType: "number" },

     { headerText: "Description", key: "Name", dataType: "string", width: "150px" }

    ],

    dataSource: adventureWorks,

    width: "400px",

    height: "500px"

    });

    }

     

    igGridPaging renders only the required (visible) rows (according to the page number and rows per page settings) from the data source. When you destroy paging the grid is not recreated to show all of the rows. You should do this by yourself.

     

    Hope this helps,

    Martin Pavlov

    Infragistics

Children