this is my code
var store = {
roles_store: new Ext.data.Store({
autoLoad: false,
proxy: new Ext.data.HttpProxy({
url: 'a/b/c',
}),
remoteSort: true,
baseParams: {
},
reader: new Ext.data.JsonReader({
totalProperty: 'total',
root: 'root',
fields:['roles']
}),
})
};
this is my json
{“total”:3,”root”:[{“roles”:”A”},{“roles”:”B”},{“roles”:”C”}]}
If I wnat to add data into Ext.data.Store. How can I do?
(PS:Sorry,my English is not well. And my extjs is :http://docs.sencha.com/ext-js/3-4/#!/api/Ext.data.Store-method-addSorted)
This should work:
Check the examples here: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.data.Store
For v3.4:
You need to use the jsonstore:
http://docs.sencha.com/ext-js/3-4/#!/api/Ext.data.JsonStore