分页在grails中无法正常工作
我有一个控制器,他给我一个对象列表分页在grails中无法正常工作,grails,paginate,Grails,Paginate,我有一个控制器,他给我一个对象列表 def historyInstance = History.findAllByPatient(patientInstance) def total = historyInstance.size() [historyInstanceTotal: total,historyInstanceList: historyInstance] 我不在historyController中,但我想在视图中为每页最多3个对象分页 <g:pa
def historyInstance = History.findAllByPatient(patientInstance)
def total = historyInstance.size()
[historyInstanceTotal: total,historyInstanceList: historyInstance]
我不在historyController中,但我想在视图中为每页最多3个对象分页
<g:paginate total="${historyInstanceTotal}" />
但似乎我需要参数,但我不能使用它,因为结果是错误的
你知道我该怎么解决这个问题吗
主意
也许
不知道要分页什么,我如何链接这两个(
和历史实例列表
)以便正确分页,我想到了这个观看生成所有的以及grails是如何做到的。确实有一个可以使用的max
属性
max(可选)-每页显示的记录数(默认值)
至10)。仅当params.max为空时使用
底部显示的页数是正确的,但是我在页面中得到了整个集合,底部的数字对我来说毫无意义。