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

查看:184
本文介绍了服务器端在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'
}

而在服务器端你将会得到一个排序dir请求参数指定排序字段和方向。当列被点击时,商店将根据您选择的列和方向进行排序。

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天全站免登陆