In treegrid you cannot use datatype = 'local'. So instead of "local" I set datatype = 'jsonstring', defines empty fake data and jsonReader. jsonReader should be defined correctly according to your data. Thanks for Oleg answer . And, when I need to load data, I just change the data type to "json".
var fakeData ={ rows: [] }; ... datatype: 'jsonstring', datastr: fakeData, ... jsonReader: { repeatitems: false, root: function (obj) { return obj.rows; }, page: function (obj) { return 1; }, total: function (obj) { return 1; }, records: function (obj) { return obj.length; } }
qwertydodo
source share