Welcome to the Angular feedback portal. We’re happy you’re here! If you have feedback on how to improve the Angular, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
I'm fighting for days with the Angular Grid and I haven't achieved the desired results but, at least, I can describe what's wrong in the grid behaviour:
Desired result: I want to preserve the state of the grid, including sorting and paging options.
It doesn't work properly!
The grid events are fired incorrectly upon initiallization. My grid is working with the async pipe and is set as shown in your examples, with a handler for the dataStateChange event on wich my data service is executed to get a result datased based on the state of the grid. This works fine for the first time, but when there is paging and ordering applied if you go outside the page and return again then the dataStateChange event is fired three times, producing 3 API requests and letting the data of the grid and it's navigation state in an inconsistent manner, making it unusable...
The two unnecesary calls are caused by the internal apply of the page settings and the sort settings, but these operations should not cause a dataStateChange event prior to the grid being fully initialized.
Please, correct it ASAP, it's a critical bug. The dataStateChange must not be fired more than once during the grid initalization, as data should be requested once, with the correct restrictions applied.
Alternatively, please provide a method to applyPersistData() without firing any dataStateChanged events. This way data navigation state could be persisted and restored independently of data itself.
Also, the grid is not honoring the initial pageSettings, instead is forcing another API requests. You should allow to pass the initial settings for paging in a one time binding manner, that is allowing this kind of initilization on the attributes:
pageSettings = "{ pageSize: 20, ... }"
instead of:
[pageSettings] = "{ pageSize: 20, ... }"
because most times this value is not used again in the component code, or it's accesible directly via the grid properties.
I haven't investigated yet, but I suspect that filtering options may cause dataStateChange event as well, so the problem extends to these settings too... Please, take into account.
Thanks in advance