【发布时间】:2011-12-13 15:34:17
【问题描述】:
这段代码有什么问题,因为我将所有结果都返回到视图中,这让我加载太多。我希望它每页只返回 5 个。
控制器:
{
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]
}
普惠制
<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,它应该可以工作。
【问题讨论】:
-
对此有什么帮助吗?还是不行
标签: grails controller pagination