|
Is it possible to add search constraints to the filterPaneService.filter(...) call in the filterPane action? Let's say the user wants to filter a list of Books by author in the filterPane dialog but I, the programmer, want to futher limit the results because I don't want to show the books that are marked as "hidden", and obviously the user is not going to mark this constraint in the filterpane dialog and I don't want to expose it.
In other words, the user wants a Book.findAllByAuthor('name') and I want to give him Book.findAllByAuthorAndHidden('name', false) . But filterPane has to handle all this restrictions. I could just execute the filter call and get all the books filtered by author, and then go thru the list and discard the hidden ones, but I would like the filterPane service quickly to do everything in its DB query. If it is not possible or there's no clean and efficient workaround, it would be nice to have this functionality added to the plugin. |
|
Yes, this is possible, but there is no built-in support for it yet in the plugin. You will want to add a couple parameters to the map you pass to the filter service. I do this now for creating pre-configured links to filtered content (another tag I need to add to the plugin). For the example you used below, the following parameters should work for you.
[ 'filter.op.hidden' : 'Equal', 'filter.hidden' : true ] There is already a JIRA ticket for adding a static filter feature, which should cover the functionality that you want. See http://jira.grails.org/browse/GPFILTERPANE-34 If the sample parameters don't work for you, or you need further assistance, let me know. Cheers, Steve On Fri, Aug 12, 2011 at 8:02 AM, gatherer <[hidden email]> wrote: Is it possible to add search constraints to the filterPaneService.filter(...) |
|
Thx Steve, it works great.
Another question, is there a way to pass params to the filterPane action? I can't find in the docs, in the filterPane tag description I can only find how to change the default action. |
| Powered by Nabble | Edit this page |
