Problem With Saving the specific check boxes values dynamic

when you click save button, how to save only new checked check boxes values in the database instead of previously checked check boxes values ??
Here am using the dynamic array of data. Can you Please help me for this ? (processing time is taking more and all requests are going again and again)
Reference :
(List of Checkbox values)
first time page load values.
Previously checkbox values in the grid: 1=Checked ; 0=unchecked

  1. 1
  2. 1
  3. 0
  4. 0
  5. 0

for saving ( how to send post request for new checked values not previously checked values)

  1. 1
  2. 1
  3. 1 ----> only this need to save
  4. 1 ----> only this need to save
  5. 0

function fnSave()
{
var rowId = grid.getSelectedRowId();
var data = new Array();
var viewModel = {};
grid.filterBy(0, “”);
var checked = grid.getCheckedRows(0);
if (checked != “”)
data = checked.split(",");
}

You can use onCheck event

docs.dhtmlx.com/api__link__dhtm … event.html

and store ID of checked items. So when you need to save data, only those saved items will be saved, after which you can reset the array used for tracking.

Also, the default data saving logic of grid ( dataprocessor ) is created in such way that it will track and save only new changes, you can use it instead of a custom solution.