2013-03-07 47 views
0

隨着代碼的咆哮,我試圖給一個沒有商店關聯的FilteringSelect分配一個新的商店。Dojo FitleringSelect在dojo商店獲得關聯後沒有響應

我的問題是,我得到的點擊女巫是FilteringSelect當一個錯誤是: *遺漏的類型錯誤:對象的翻譯:有沒有方法「查詢」 *

console.log("alternate on movement create");     
storeData = new Write({url: "/account/getall", clearOnClose: true, urlPreventCache: true}); 
storeData.fetch({ onComplete: function() { console.log("done");} }); 
console.log("after new read");        
dijit.byId("far_mt_accountbundle_movementtype_toAccount").store = storeData; 

我使用道場1.8

謝謝你的幫助。

回答

3

看起來您正在使用ItemFileWriteStore,它是不推薦使用的dojo.data API的實現。要使用帶有FilteringSelect的ItemFileWriteStore,您應該將它包裝在dojo/store/DataStore

require(['dojo/store/DataStore','dojo/data/ItemFileWriteStore'],function(DataStore,Write){ 
    var writeStore = new Write({url: "/account/getall", clearOnClose: true, urlPreventCache: true}); 
    var dataStore = new DataStore({store: writeStore}); 
    dijit.byId('filteringSelect').set('store',dataStore); 
}); 
+0

謝謝,您的幫助非常好。幾個小時左右就這樣。看不到任何會幫助我的東西。 – 2013-03-07 19:24:49