-
Notifications
You must be signed in to change notification settings - Fork 810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added demo datagrid save settings to url #1111
Added demo datagrid save settings to url #1111
Conversation
…son serialization and base64 encoding
If DataGrid Settings has value, the ReloadOnFirst call is not needed, since after the settings are loaded, Reload will be called again with the settings If DataGrid Settings == null need call ReloadOnFirstRender
Hi @k-Sacr, Thanks for your pull request however in my opinion the example is too specific to your case and we will unable to merge and support it. Loading also state before initialization of the component will not restore the DataGrid state properly - for example filtering will not be applied. I'm afraid that we cannot merge this. |
Hi @enchev thanks for your feedback. Is the ability to share a link to a page with a datagrid where all the necessary settings (filters / sorting / grouping) are set to other users so specific?
Are you talking about code changes Because if remove the extra loaddata call, it will greatly speed up loading, which will be especially noticeable with complex queries. |
@enchev Thanks for the screenshots, I did some more testing
otherwise there will be an error
Without chrome_2023-08-15_00-54-00.mp4With chrome_2023-08-15_00-57-25.mp4 |
Exactly, this change will not affect the current demos/projects in any way. But if the settings are stored in db/redis/url and call LoadStateAsync before FirstRender (for example OnInitialized/OnInitializedAsync/SetParametersAsync), then this will remove an extra critical request in ReloadOnFirstRender (where settings are not taken into account), and then Reload with settings will be called. Then the "flickering" disappears (the first display without settings, then with the setting) and we remove the extra request, for large tables are x2 optimization. And to show how it works, I added a new demo page. |
Here is the change as I promised: |
Thx! |
Added a demo example of saving datagrid settings to url query using json serialization and base64 encoding.
Fix multi LoadData with settings:
Before:
After:
If remove
and move LoadStateAsync() to OnInitialized/OnInitializedAsync/SetParametersAsync