ExtJS GridPanel 中的服务器端排序 [英] Server Side sorting in an ExtJS GridPanel

查看:28
本文介绍了ExtJS GridPanel 中的服务器端排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个分页的 GridPanel,但不知道如何添加服务器端排序.我是否为 sortChange() 事件添加了一个监听器?我覆盖它吗?或者还有其他我应该参与的活动.

I have a paged GridPanel and don't know how to go about adding server side sorting. Do I add a listener for the sortChange() event? Do I override it? Or is there another event that I should work with.

任何帮助将不胜感激.

推荐答案

没有.在您商店的定义中设置

No. In the definition for your store just set

remoteSort: true, // to enable sorting
sortInfo: { // the default sort
    field: 'someField',
    direction: 'ASC' | 'DESC'
}

在服务器端,您现在将获得指定排序字段和方向的排序和目录请求参数.当点击列时,商店将更新,按您选择的列和方向排序.

And on the server side you will now be getting a sort and dir request parameters specifying the sort field and direction. When the columns are clicked the store will update sorted by the column and direction you pick.

这篇关于ExtJS GridPanel 中的服务器端排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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