-
Notifications
You must be signed in to change notification settings - Fork 760
[NG] Datagrid: URL-persisted state #377
Comments
How would this work with pages that are already using query/matrix parameters? Would it be easier to just expose a hash of all the datagrid settings? Also if the data shown in the table is dynamic, what should happen if invalid query parameters are supplied ( |
@youdz 👌🏻 Having named datagrids would be one decent way to avoid conflicts. Maybe the state of each datagrid can be represented like this.
Transforming the state into Matrix URL notation would be better I feel. For starters the |
Is there any update on this? I see that the Datagrid currently emits this state object whenever it is interacted with but there does not seem any straightforward way to set the |
I'm looking for something similar. I have refresh(state: ClrDatagridStateInterface) dispatch an action to preserve the datagrid state in ngrx/store. When I initialize the component it'd be nice to have a way to easily set the state. Any ways to do this currently? |
We've reviewed this recently and decided it is not likely to be a feature due to complexities (especially with multiple datagrids on the page). The better alternative is to focus on #2094 as an input/output that can be easily cached by the application instead of internalizing state like this. Closing as something we won't be focusing on in order to help clean up backlog. |
Hi there 👋, this is an automated message. To help Clarity keep track of discussions, we automatically lock closed issues after 14 days. Please look for another open issue or open a new issue with updated details and reference this one as necessary. |
Select one ... (check one with "x")
Expected behavior
We should have an option that updates the query parameters of the URL to track the state of the datagrid. It would allow to hit previous/next in the browser to come back to visited pages, or undo a filter or a sort. More importantly, it allows the datagrid to navigate to a "details" page when an item is clicked, then come back with the "previous" button of the browser to the datagrid, in the exact same state as when the user left.
Since we can have multiple datagrids on a single page, the query param should be customizable to avoid conflicts. It would look like this:
And produce a url with query parameters
users_page
,users_sort
,users_filter
, ...This is obviously a first draft and will depend on the complexity of the implementation
The text was updated successfully, but these errors were encountered: