Kliver Max
Kliver Max

Reputation: 5299

Can't sort column with ExtJs

In ExtJs 3.4 application i have a store:

    var roadStore = new Ext.data.Store({
    url:url_servlet+"/roadsJson.jsp?type=summer",
    reader: new Ext.data.JsonReader({
            root: 'data',
          }, [ {
             name : 'name', sortType : 'string', mapping :'name'
          },{
             name : 'road_id', sortType : 'string', mapping :'road_id'
        }]
    ),
});

And columns model:

            columns:[
            {id:"column1", header:'Название дороги',width:300,sortable: true,dataIndex:'name'},
            {id:"column2", header:'Id',width:300,dataIndex:'road_id',hidden:true}],

And a problem: columns not sortible. I click on column header but sort not work. Whats can be wrong?

Upvotes: 0

Views: 3566

Answers (1)

user1721713
user1721713

Reputation: 493

I think the problem is with the sortType : 'string'. It can be just:

sortType : 'asDate'
sortType : 'asFloat'
sortType : 'asInt'
sortType : 'asText'
sortType : 'asUCString'
sortType : 'asUCText'

See documentation for more information: http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.data.SortTypes

Upvotes: 1

Related Questions