-
Notifications
You must be signed in to change notification settings - Fork 11
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
Grid identifier #124
Conversation
Don't Select Disabled
There was a problem hiding this 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.
#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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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 |
This PR resolves #123