Closed asgeo1 closed 9 years ago
Couldn't you allow this? Everything else can be initialized for the grid except the filters.
What do you mean? Allow what? What doesn't work in your example?
@leikind - I mean that I tried to pass in the :f
option to initialize_grid
.
You can't do that, because it gets rejected with an error message as its an unsupported option.
But I think it should be accepted, as there doesn't seem to be any other way of preselecting the filter values. (other than populating params
).
Maybe :f
isn't the best name for that option. That's just what gets returned though when you call the status
method though, so I guess it should be consistent.
Ah, now I understand. Of course, :f
is not an option. And it shouldn't be.
Look how I implemented a similar functionality. Controller:
session[:contents_grid_settings] = params[:g]
and then in my view:
link_to 'navigation.contents'._, contents_path(session[:contents_grid_settings])
I'm trying to make all of the filtering, sorting, pagination settings be remembered in the session.
So if the user navigates to the detailed page and then returns, all of the settings for the grid are still in place. (this seems easier than passing them through multiple forms...)
This is my current attempt:
Notice I can't pass through the
f
param so I can preset the filters.Couldn't you allow this? Everything else can be initialized for the grid except the filters.
Obviously I can work around it by just setting the params hash, but I'd rather not.
Cheers