我想声明一个从 DataStore 获取值的全局变量。
var myStore = new Ext.data.Store({
id: 'ID_myStore',
proxy: new Ext.data.HttpProxy({
url: 'get.php',
method: 'POST'
}),
baseParams:{task: "LIST"},
reader: new Ext.data.JsonReader({
root: 'results',
totalProperty: 'total',
id: 'id'
},[
{name: 'Class', type: 'string', mapping: 'class'}
])
});
var BestClass = myStore.getAt(0).get('Class');