Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ExtJS setting a default sort on a remote sort store?

Tags:

extjs

Is there a way in ExtJS 4.1.3 to set a default sort on a Grid with a backing store set to remoteSort: true?

like image 431
James McMahon Avatar asked Feb 06 '13 21:02

James McMahon


2 Answers

I missed the sorters config in documentation, the default sort can be set by

sorters: [ {
    property: 'valuetosort',
    direction: 'ASC'
} ],
like image 71
James McMahon Avatar answered Nov 08 '22 00:11

James McMahon


Also, if you want to set sorters dynamicaly and remoteSort is true, then you can use method sort and pass sorters configuration into single parameter.

store.sort([{
    property: 'valuetosort',
    direction: 'ASC'
}])
like image 3
Sergii Shvager Avatar answered Nov 08 '22 00:11

Sergii Shvager