this is my code
var store = {
user_store: new Ext.data.Store({
autoLoad: false,
proxy: new Ext.data.HttpProxy({
url: a/b/c
}),
remoteSort: true,
baseParams: {
dir: 'ASC',
sort: defaultSort,
start:0,
limit:pagesize
},
reader: new Ext.data.JsonReader({
totalProperty: 'total',
root: 'root',
fields:['fullname', 'first']
})
}),
};
I can use “store.user_store.getSortState().direction” and “store.user_store.getSortState().field” to get dir string and sort string.
But I can’t know. When did user change the dir string and sort string.
I try to solve my question.
this is my code
var dir =defaultDir;
if((store.user_store.getSortState().direction))
{
dir =store.user_store.getSortState().direction;
}
var sort =defaultSort
if((store.user_store.getSortState().field))
{
sort =store.user_store.getSortState().field;
}
But the windows say: TypeError:store.user_store.getSortState() is undefined. How can I do?
(PS:Sorry,my English is not very well. my extjs is v3.4)
http://docs.sencha.com/ext-js/3-4/#!/api/Ext.data.Store-cfg-sortInfo
1 Answer