EasyUI Forum
May 02, 2024, 09:32:01 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Tip - Selected records from a datagrid not removed from memory after delete  (Read 9827 times)
Kevin
Jr. Member
**
Posts: 52


View Profile Email
« 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.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!