0
這段代碼有什麼問題,因爲即時獲取所有結果返回到視圖,這需要我加載太多。我希望它每頁只返回5個。Grails paginate用法
控制器:
{
def channel2 = Channel2.list(params)
//def prog = Programmation.list()
def prog
def progs = [:]
def temp
channel2.each{
Programmation p = Programmation.withCriteria {
eq('prog_channel', it)
'between'('prog_start', new Date(), new Date() +1)
}
progs.put(it.id, p)
}
[channel: channel2, program: progs]
}
GSP
<g:render id="" template="/layouts/canais"/>
<g:paginate next="Forward" prev="Back"
maxsteps="0" max="3" controller="teste"
action="myProgramms_canais"
total="${tv_megazineplus.Channel2.count()}" />
我上無法弄明白。我跟着Grails helpPage,它應該工作。
對此有何幫助?仍然沒有工作 – recoInrelax