开发者

How do I sort view list results in a crudify lift "page"?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜