Open rongworks opened 10 years ago
I don't think you are declaring it incorrectly, could be a bug.
While this helper is not working properly why don't you just add the parameter to your link helper manually?
cards_path('cards[f][customers.customer_reference]' => @customer.customer_reference)
You are right. The most obvious solution was out of my sight, too focused on getting this part to work. Thanks for pointing it out. Should the issue stay open as a potential bug report?
yes please, let it stay
I just ran across this issue as well. The wice_grid_custom_filter_params method returns the following:
{ "#{options[:grid_name]}[f][#{attr_name}][]" => options[:value] }
The final [] is hard-coded. This works fine for custom drop-down filter columns, but not for free-text fields. It looks like you only need [] if you are passing multiple filter values to a single attribute, and the method doesn't currently let you pass multiple parameters.
A couple of suggestions, based on my admittedly superficial understanding of how the grid works..
Hi, I have a problem with HTML link generation for filters (from http://wicegrid.herokuapp.com/custom_filter_params). There are 2 models Card, Customer with a " Customer - 1:n - Card " relation. In my cards_grid I define a column for the customer reference:
In my Customer-View i'm using wice_grid_custom_filter_params:
When using these params for normal attributes (attributes of Card model) I get a filtered grid, like expected. But the link above creates the following url:
http://localhost:3000/cards?cards[f][customers.customer_reference][]=XXX
which doesn't filter anything. When I change the url manually tohttp://localhost:3000/cards?cards[f][customers.customer_reference]=XXX
deleting the last bracket pair, I get a filtered grid.I can get it to work by following these examples http://wicegrid.herokuapp.com/custom_filters2 and using the customer_id attribute and a custom_filter, but I don't want to use dropdowns for filtering the customer_reference but a text field.
I'm stuck now.. is there anything wrong with the way I'm declaring the filter_params?