I have grid with X number of rows. Whenever i the grid is bound with a dataset, i need to make sure that the records present in Grid should be removed and add only records from data set
For eg: if ID 102 is already present in grid as well as it is present in new result set, while adding additional details, grid should remove 102 and add it from the new result set.
I wrote the below code to do this . but this is very performance inefficient, when i have 100 records in the grid and new result set adds another 100 records, this is hanging the page.
Please help.
var gridExistingData = datasource.data();
$.grep(gridExistingData, function (d) {
if (resultData.length > 0) {
if (d != null && d.AssetID == resultData[i].AssetID) {
gridExistingData.remove(d);
}
}
});
Please suggest if there is any alternative process to achieve this