3

我正在尝试实现filteringselect(dojo)我正在尝试从内存存储中获取值。我可以filteringselect在我的页面上看到,但它没有返回任何东西,而且萤火虫一直在说store.fetch is not a function

下面是代码片段。有什么线索吗?

store1 = new dojo.store.Memory({data: fArr});
   var f1 = new dijit.form.FilteringSelect({
                    name: "Ans",
                    searchAttr: "No",
                    placeHolder: "Select",
                    store: store1
                }, "filteringSelect");
        f1 .placeAt("s1");

问候。

4

2 回答 2

5

dojo.store.Memory 使用新的存储 API,而 FilteringSelect 正在尝试使用旧 API (fetch) 访问它。

您可以尝试使用 dojo.store.DataStore 适配器,以便将新样式存储传递给需要旧接口的东西。

new dijit.form.FilteringSelect({
    //...
    store: dojo.store.DataStore(store1)
});
于 2012-03-21T19:27:43.267 回答
1

商店:dojo.data.ObjectStore({ objectStore:store1})这对我有用..

于 2012-03-22T13:10:41.610 回答