Skip to content

Grid identifier #124

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

Conversation

mayur-ownerrez
Copy link
Contributor

This PR resolves #123

@ithielnor ithielnor changed the base branch from master to cookie-refactor July 5, 2024 13:21
Copy link
Collaborator

@ithielnor ithielnor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can work, but there is a simple solution on the implementation side... just don't use the same controller action twice. If you really want that same exact behavior, make another action that calls into it.

This seems unnecessary to me and I'm not sure we should add it to the library.

Comment on lines +533 to +542
#if NETFRAMEWORK
string cookieSuffix = (controller.ControllerContext.RouteData.Values["GridIdentifier"] as string);
#else
string cookieSuffix = (routeData.Values["GridIdentifier"] as string);
#endif

if (string.IsNullOrEmpty(cookieSuffix))
cookieSuffix = items["GridIdentifier"];

cookieSuffix = !string.IsNullOrEmpty(cookieSuffix) ? "_" + cookieSuffix.ToLower() : string.Empty;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, but I think we should use a short querystring param name. Maybe gid or something like that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wanted to understand what is driving factor of reaming it to gid? I prefer long variable name so that it convey the usage without extra details (It could be just me) please advice.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually I would too, but since this is part of the route data which is transmitted in the URL I prefer short.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have raised the new PR: #125 for all these changes

@mayur-ownerrez
Copy link
Contributor Author

This can work, but there is a simple solution on the implementation side... just don't use the same controller action twice. If you really want that same exact behavior, make another action that calls into it.

This seems unnecessary to me and I'm not sure we should add it to the library.

We can tweak the implementation by having two separate action etc. but it seems very common to use same controller action twice in MVC. Also even if the Controller & Actions are on different routes/areas we might end up having the same issue. GId will be helpful to distinguish the right grid, specifically when we are storing grid settings (filter/sort/pagination etc.) in cookie, but please suggest if we want to avoid this change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support multiple grids on a page pointing to same URL/Action
3 participants