Adding a search / filter to the list of forests. Gsp

I have been looking for some of the latest Grails books and many open source projects for samples and best practices for adding search / filtering features to scaffolded list.gsp: s, for example, so that it works with pagination and sorting, etc. This might be a simple task, but as a newbie to Grails, it would be helpful to extract some thorough samples.

The closest I found is the FilterPane plugin, but this is a very general solution, so the code can be unnecessarily complicated to modify a more custom search / filter. Does anyone have or has anyone seen a good sample code for this? I think this is a very common requirement, so it should be there ...

+4
source share
2 answers

Check out http://jira.codehaus.org/browse/GRAILS-5225 , this is a set of alternative forest patterns. They support filtering and search (if you add a search plugin). Scaffolding templates take a little effort, but they will show you how to do it.

Another plugin to test is the Criteria plugin.

There is also an UberScaffoling Plugin that allows you to enter code into the scaffolding of which I am the author, but I have not published the updated one after a while, and I think that it may have a bunch of errors right now, Let me know if you are interested in this - I could write you the latest version (you need to take the time to publish the grails plugin repository).

+2
source

Check this blog post - https://blog.uni-koeln.de/rrzk-knowhow/2012/03/14/add-filter-pane-to-your-customized-scaffolded-templates-for-list-pages/

The only drawback is the need to reprocess the style for the filter in order to look neat.

filterpane: 2.0.1.1 Grails 2.0.4

+1
source

Source: https://habr.com/ru/post/1298929/


All Articles