Server Side sorting in an ExtJS GridPanel
Asked Answered
F

1

9

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.

Any help would be appreciated.

Footplate answered 24/3, 2011 at 15:39 Comment(0)
G
16

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.

Grecoroman answered 24/3, 2011 at 16:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.