2
我有:在賣場中創建煎茶 - store.each() - 數據無法獲得,他們只是深藏於數據類
Ext.define("catcher.view.Login", {
extend: "Ext.form.Panel",
// creating login form, including selectfield
商店「錦標賽」(自動加載:真),有其模型。 Everyting被設置。 需要動態地(在view.Login類仍然)填寫selectfield:
initialize: function(){
var store = Ext.getStore("Tournaments");
var options = new Array();
store.each(function(radek){
options[radek.get("tournament_id")] = radek.get("tournament_name");
});
}
我不想使用store:"Tournaments"
配置選項,因爲以後form.submit的,();不會從selectfield
發送正確的數據。
有問題:console.log(store.getCount());
返回0使用store.add({ ... })
我可以添加任何東西,getCount將()返回corrent數(0 +添加())。
奇怪的部分:console.log(store)
返回整個類,包括data
對象與所有項目裏面。下一個奇怪的部分 - 如果我在控制器中使用相同的代碼,一切正常,Store正確加載,我可以使用mystore.each();
謝謝,太好了。我認爲當數據加載到'data'類時,它們也準備好使用。 – 2013-03-08 11:38:20