Get original data after changes and save on database only cells modified

Tags: #<Tag:0x00007efc61feabf0>

Good morning
I know there is no command to get the data before the changes and compare it with the actual data to understand which cells are changes and save only the modified in the database.
I ask you to add this features in the next release.

So I write this JFiddle.
https://jsfiddle.net/crepuscolog/xg3rynzp/49/

At the top of the javascript there is
var dataSourceOnLoad = [];
I create an array where save data after load
Then the javascript populate the grid
Then I click on link “afterLoad” so the array dataSourceOnLoad is loaded.
Then when I click on link “View” I can see in the console the values of the array and for column Dex1 is empty.

After I modify one cell the array is changed also if I’m not reload the array by clicking on link “afterLoad” infact if you click on “View” you can see the change.
I aspect that the array dataSourceOnLoad will not change.
Why this ?

So the questions are 2:

  1. May you implement a features to know in an array every moment which cells are changed ? Then need also a feature to empty this array.
  2. Why my dataSourceOnLoad array changes ?

Thanks
Best regards<

Good morning
I understand the reason.

$("#s1").on(“click”, function () {
dataSourceOnLoad = ht.getSourceData();
})

must be

$("#s1").on(“click”, function () {
dataSourceOnLoad = ht.getData();
})

But why tha array dataSourceOnLoad in the first case dataSourceOnLoad = ht.getSourceData() is always refreshed ?
And also I hope you will create the new feature I asked before.
Regards

Welcome @crepuscolog

I am glad that you have already found a solution.

The view and data is re rendered each time a new change is passed or the method render is called.