开发者

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

开发者 https://www.devze.com 2023-03-21 09:32 出处:网络
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?

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

精彩评论

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

关注公众号