Reputation:
Grails scaffolding defaults to 10 rows per page. I would like to increase that number without generating the views and changing the 10 in every file. Where do I change the default?
Upvotes: 2
Views: 1652
Reputation: 39
Add to the uri:
?max=<num_rows_desired>
For instance:
http://projecthost:8080/Library/Books/list?max=20
Upvotes: 0
Reputation: 3143
Ok, if you use dynamic scaffolding a workaround for this bug, is edit directly in your GRAILS_HOME/src/grails/templates/scaffolding
Upvotes: 1
Reputation: 3143
You have to install scaffold templates with:
grails install-templates
Now, edit in src/templates/scaffolding Controller.groovy and increase the value params.max as you want
Upvotes: 3
Reputation: 3069
I found this but can't get it to work. You're supposed to be able (according to this) to scaffold and then override the actions you want (say list) in your controller, but like I said, it doesn't work for me...
class PersonController {
def scaffold = true
def list = {
if(!params.max) params.max = 20
[ personList: Person.list( params ) ]
}
}
Upvotes: 1