Please follow the instructions in order to fix the issues caused by the upgrade from version 0.5.x to version 0.6.x.
-
1. We changed the getAll method to return an array with records instead of array with record id and record object.
version 0.5.x code
var grid = $('selector').grid(),
records = grid.getAll();
alert('First record: ID=' + records[0].id + ', Name=' + records[0].record.Name);
version 0.6.x code
var grid = $('selector').grid(),
records = grid.getAll();
alert('First record: ID=' + records[0].ID + ', Name=' + records[0].Name);
-
2. We removed the pager.enable configuration option. In version 0.6 we enable the pager if the pager configuration option exists.
version 0.5.x code
$('selector').grid({
pager: { enable: true, limit: 10 }
});
version 0.6.x code
$('selector').grid({
pager: { limit: 10 }
});
-
3. We renamed the dataKey configuration option to primaryKey.
You have to replace dataKey with primaryKey everywhere in your project after the upgrade to version 0.6.x+.
version 0.5.x code
$('selector').grid({
dataSource: 'url_to_data',
dataKey: 'ID'
});
version 0.6.x code
$('selector').grid({
dataSource: 'url_to_data',
primaryKey: 'ID'
});
-
4. We moved the grid data on the root level and removed the grid prefix.
version 0.5.x code
var grid = $('selector').grid({ dataSource: [] });
var configuration = grid.data('grid').dataSource;
version 0.6.x code
var grid = $('selector').grid({ dataSource: [] });
var configuration = grid.data().dataSource;