After a long search trying to figure out why our records weren't being removed, I have discovered that there is a bug in the datasource method removeRecordByKey: if the original data source is a simple array, the item in origDs will not be removed.
This is a problem if the grid is rebound since the original data source will be used.
We discovered this issue because we had to use the dataSource deleteRow method directly due to severe performance issues that occur when attempting to remove a large number of rows through the standard updating method deleteRow. We have a scenario where we could remove hundreds of items from the grid at once because the user has chosen to process them in some way that requires their removal.
The workaround that we implemented was to test each data source that is processed by the loop to see if the primary key value was present and, if not, use the index of the primary key column from the datasource's schema.
Hello Karl ,
Upon further investigation on the scenario the development team has found out that the problem is due to the fact that committing and deleting changes in igArrayDataSource are not taking effect.
I’ve logged it as a new development issue with number: 167937.
I’ve also opened a private case for you with number CAS-133692-K3Q6P8 so that you may track its progress.
You can view the status of the development issue connected to that case by selecting the "Development Issues" tab when viewing this case on the web site.
Let me know if you need more information.
Best Regards,
Maya Kirova
Developer Support Engineer II
Infragistics, Inc.
http://es.infragistics.com/support
Thank you for posting in our forum.
I’ve tested this scenario and discussed it with the development team.
By design the removeRecordByKey method will not affect the original data source, instead the changes are persisted in the data source object’s data().
So for example if you’ve removed a record using:
ds.removeRecordByKey(<some record key>);
And you call dataBind() on the grid or data source, it will bind to the original data source and the row won’t be removed.
Instead you can set the data source to the updated data in ds.data():
$("#grid").igGrid("option", "dataSource", ds.data());
Which will persist the removing of the row.
I’ve attached an example for your reference. Let me know if it’s similar to your own scenario and if this solution would work for you.