EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
May 02, 2024, 09:32:01 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
Tip - Selected records from a datagrid not removed from memory after delete
Pages: [
1
]
« previous
next »
Print
Author
Topic: Tip - Selected records from a datagrid not removed from memory after delete (Read 9827 times)
Kevin
Jr. Member
Posts: 52
Tip - Selected records from a datagrid not removed from memory after delete
«
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
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...