I am using a CRUD开发者_运维百科ify object to do a simple admin app. I would like to sort the results that the "list" page displays. Is there a quick way to do this?
Thanks.
I figured out by reading the source:
If you extend CRUDIFY you can override findForListParams to do this. The following will order by the description field ascending
override def findForListParams = {
List(OrderBy(description, Ascending))
}
I found a better way to order using crudify, just add :order => 'name ASC'
code:
crudify :'refinery/glossaries/glossary',
:title_attribute => 'name', :xhr_paging => true, :order => 'name ASC'
ta.
精彩评论