getAllReturns: number

Return an array with all records presented in the grid.

Parameters

NameTypeDescription
includeAllRecords {boolean} include records that are not visible when you are using local dataSource.

Examples

Local DataSource

    
 <button onclick="alert(JSON.stringify(grid.getAll()))" class="btn btn-default">Get All Visible Records</button>
 <button onclick="alert(JSON.stringify(grid.getAll(true)))" class="btn btn-default">Get All Records</button>
 <br/><br/>
 <table id="grid"></table>
 <script>
     var data, grid;
     data = [
         { 'ID': 1, 'Name': 'Hristo Stoichkov', 'PlaceOfBirth': 'Plovdiv, Bulgaria' },
         { 'ID': 2, 'Name': 'Ronaldo Luis Nazario de Lima', 'PlaceOfBirth': 'Rio de Janeiro, Brazil' },
         { 'ID': 3, 'Name': 'David Platt', 'PlaceOfBirth': 'Chadderton, Lancashire, England' }
     ];
     grid = $('#grid').grid({
         dataSource: data,
         columns: [ { field: 'ID', width: 56 }, { field: 'Name' }, { field: 'PlaceOfBirth' } ],
         uiLibrary: 'bootstrap',
         pager: { limit: 2, sizes: [2, 5, 10, 20] }
     });
 </script>

  

Remote DataSource

    
 <button onclick="alert(JSON.stringify(grid.getAll()))" class="btn btn-default">Get All Visible Records</button>
 <button onclick="alert(JSON.stringify(grid.getAll(true)))" class="btn btn-default">Get All Records</button>
 <br/><br/>
 <table id="grid"></table>
 <script>
     var grid = $('#grid').grid({
         dataSource: '/Players/Get',
         columns: [ { field: 'ID', width: 56 }, { field: 'Name' }, { field: 'PlaceOfBirth' } ],
         uiLibrary: 'bootstrap',
         pager: { limit: 2, sizes: [2, 5, 10, 20] }
     });
 </script>