Grails extJS网格分页 [英] Grails extJS grid paging

查看:66
本文介绍了Grails extJS网格分页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我对extjs和grails有问题. 当我尝试调用网格的下一页时,我没有对象. 网格仍然带有旧对象. 我该如何对网格进行分页?

Hy, I have a problem with extjs and grails. When I a try call the next page of the grid, I don't have the objects. The grid still with the old objects. How can I do to paginate my grid?

推荐答案

将以下添加到您的商店cfg:

add below to your store cfg:

paramNames: {start:'offset',limit:'max',sort:'sort',dir:'order'},
baseParams: {offset:0,max:this.pageSize},

然后是控制器:

def result = Floor.createCriteria().list(
   max:params.int('max')?:100, 
   offset:params.int('offset')?:0
) 
render ([count:result.totalCount,data:result] as JSON)

这篇关于Grails extJS网格分页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆