setAttribute after refresh grid via updateFromJSON

Hello all,

I have a problem with the grid component.

What I am trying to do is this:

  • after the user modified a value in the grid a server-side calculation is triggered
  • after the calculation is finished the new values should be loaded via the method updateFromJSON into the grid
  • after loading the new values, the attribute “title” should be filled with data from the json-response-data

What I did:

myDataProcessor.attachEvent(“onAfterUpdateFinish”, function () {
myGrid.clearAll();
myGrid.load(“data.json”, ‘json’).then(function (data) {
var json = JSON.parse(data);
var i;
for (i in json.rows) {
// set tooltip
myGrid.cells2(i, 3).setAttribute(‘title’, json.rows[i].data[4]);
}
console.log(“update finished”);
}
);

Everything works this way but I have a blank screen (clear) before the new data is inserted in the grid.

My question:

  • Is there a way to refresh the data via myGrid.updateFromJSON()
  • How can I work with the json-response after update (“then” isn’t working)
  • what are the parameters of “updateFromJSON”. I could not find anything in the docs

Thanks for your help.

Yours
Tobi.

There is no updateFromJson() method in the dhtmlxGrid.
Please, try to use:

myGrid._refresh_mode=[true,insert_new,del_missed]; //insert_new,del_missed - parameters are simlar to the updateFromXML method
myGrid.load(“data.json”, ‘json’);

Thank you for your hint.
Works great.