我已经一个星期试图解决这一问题分页,但不会有好结果,Grails的分页不工作
我有这个在我的控制器
PatientController{
def show(Long id) {
def patientInstance = Patient.get(id)
if (!patientInstance) {
flash.message = message(code: 'default.not.found.message', args: [message(code: 'patient.label', default: 'Patient'), id])
return
}
def historyInstance = History.findAllByPatient(patientInstance)
def total = historyInstance.size()
[historyInstance: historyInstance,patientInstance: patientInstance,historyInstanceTotal: total]
}
}
而且我对这个代码鉴于
<g:each in="${historyInstance}" var="historyInstances" status="i">
...
</g:each>
<div class="pagination">
<g:paginate total="${historyInstanceTotal}"/>
</div>
我用params
,最大的<g:paginate>
,我什么都试过,但没有结果总是显示在视图中的一整套历史。
可能重复[Grails的分页不起作用(http://stackoverflow.com/questions/17068081/grails-paginate-doesnt-work) – doelleri