var store = new Ext.data.JsonStore({
id:'jfields',
totalProperty:'totalcount',
root:'rows',
url: 'data.php',
fields:[{ name:'jfields' },
{ name:'firstyear' , mapping :'firstyear' , type:'float' },
{ name:'secondyear', mapping :'secondyear', type:'float' },
{ name:'thirdyear' , mapping :'thirdyear' , type:'float' },
{ name:'fourthyear', mapping :'fourthyear', type:'float' },
{ name:'fifthyear' , mapping :'fifthyear' , type:'float' } ]
}
});
我想要的是在此商店的最後添加數據,但我完全困惑,我所做的是將以下代碼添加到它但不工作。
如何在json-store中添加記錄
listeners: {
load : function(){
BG_store.add([{"jfields":"Monthly","firstyear":22.99,"secondyear":21.88,"thirdyear":21.88,"fourthyear":22.99,"fifthyear":21.88}]);
}
}
但我不認爲我的概念被清除,請任何機構表現出一定的方式如何做到這一點。
thanyou非常多LIoyd,我也想出了一種方法,我也加了我的答案,再一次謝謝你 – 2010-08-04 16:59:43