This question is locked. New answers and comments are not allowed.
My grid is in client operation mode.
I'm trying to empty out the grid data via javascript:
var myGrid = $('#MyGrid').data('tGrid');
myGrid.total =0;
myGrid.dataBind([]);
the dataBind with empty data is generating a parsererror.
also, I have other buttons outside the grid that will make ajax call to grab new json data and then bind to the grid. It is working fine as long as the json data that comes back is not empty. However, when it is empty
What is the proper way for the grid to handle the data when it is empty?
I'm trying to empty out the grid data via javascript:
var myGrid = $('#MyGrid').data('tGrid');
myGrid.total =0;
myGrid.dataBind([]);
the dataBind with empty data is generating a parsererror.
also, I have other buttons outside the grid that will make ajax call to grab new json data and then bind to the grid. It is working fine as long as the json data that comes back is not empty. However, when it is empty
{ "data": [], "total": 0 }
it is also generating a parsererror but it did clear out the grid. However, the page navigation state did not get reset i.e. Page 1 and Showing 0 of 0... and still contains the navigation state per the last set of data.What is the proper way for the grid to handle the data when it is empty?