Please give me advice what is the best way to load new data or the datatable. I would like to refresh data but I notice some problem:
- Previously I used dtable.load(url) – the url contains proper start and count values – but data which was not present in http response was not deleted from datastore and still shown in table view
- I try to user dtable.clearAll(true) (before calling load() or in onBeforeUpdate) – but in this situation the table is scrolled to the beginning and loosing selected rows.
Do You have better way to refresh items in datatable?
I make some snippet which shown the idea:
the snippet work fine, since data is static, if the data is dynamic (like in comment “NOTE” and in my environment) there is problem with records that are not present in server response – they are still displayed in data table, but should not.
The refreshing should preserver sorting order, filtering state and selection rows.