I am using ExtJs 4.1.
I have a Store like this:
var predictTargetStore = new Ext.create('Ext.data.Store',{
autoLoad : false,
fields: ['label','value'],
proxy : {
type : 'ajax',
reader : {
type : 'json',
root : 'predictTargetList'
}
}
});
I will do predictTargetStore.load({url : 'getPredictTargetList.action'}) some time later.after I have done this,the combobox which used predictTargetStore will have choices. but when I try to get one item from the store,I failed.I do like this:
predictTargetStore.load({
url : 'getPredictTargetList.action'
});
var value = predictTargetStore.getAt(0).get('value');
I find predictTargetStore.getAt(0) is null and predictTargetStore.getCount() is 0. so how can I get one item of the store? thank you very much!