I have:
$.post('buying-grid/split/' + config.route.params.id, item).success(function(data){
var ds = new kendo.data.DataSource();
ds.data(data)
$('#buyingGrid').data('kendoGrid').setDataSource(ds)
$('#buyingGrid').data('kendoGrid').dataSource.sync();
})
But I am getting the error Uncaught TypeError: undefined is not a function
The data variable is in the correct format of {"data":[{"id":99296,...
Why is this not working?
When you call ds.data(data)
, data has to be an array of items. Your server backend is probably returning a response object that has the array in data.data
, so you need to call:
ds.data(data.data);