开发者

Grails equivalent of Djangos list_filter, search_fields and date_hierarchy

In Django you can specify in the controller (admin.py) what fields of a model you want to use for filtering and searching through the records of a model when you are viewing the webpage for it. E.g.

...

class BooksAdmin(admin.ModelAdmin):

  ...
  list_filter = ('author', 'pub_date', 'publisher',)
  search_fields = ('author', 'title', 'publisher',)
  date_hierarchy = 'pub_date'

admin.site.register(Book, BooksAdmin)

I know Django's "search_fields = ('author', 'title', 'publisher',)" can be replaced by Grails' searchable plugin and开发者_如何学Go specifying searchable = true in the BooKController but what's the equivalent or replacement in Grails for Django's "list_filter" and "date_hierarchy?"

Thank you.


  • Filter Pane seems to do what list_filter seems to do :D There was a filter plugin, but it hasn't been updated since 2009.
  • If I get date_hierarchy idea right, there are various date datatypes, though one has to register those type editors oneself - standard g:datePicker editor is pretty poor.
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜