このページネーションの問題を解決するために 1 週間を費やしましたが、良い結果は得られませんでした。
私は私のコントローラにこれを持っています
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>
すべてを試しましたが、結果が得られず、常にビューに履歴のセット全体が表示されます。