开发者

Server Side sorting in an ExtJS GridPanel

开发者 https://www.devze.com 2023-02-19 06:42 出处:网络
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 shou开发者_C百科ld

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 shou开发者_C百科ld work with.

Any help would be appreciated.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消