|
Title: Tip - Selected records from a datagrid not removed from memory after delete Post by: Kevin on May 17, 2012, 06:24:29 AM If you enable the idField in a datagrid and set singleSelect to false, and then select some records to be deleted. You send this list to the server and the server removes these records. You then call the reload method to reload the data, the datagrid will reload the data correctly (ie no previously selected records that were deleted are displayed). Lets say you select a new record and call the getSelections method, you will get a list containing this selected record and the previously deleted records! Note: if idField is not set, then the previously selected records are cleared with the reload. ie You don't see them in the getSelections.
So an easy way to solve this is to just call the clearSelections method before (or directly after) calling the reload method. This was driving me crazy as I thought the reload method would only have the reloaded records. Of course the reload method will not know if a record has been deleted or not if you are using paging in the datagrid. |