Store.fetch is not a function (dojo)

I am trying to implement filteringselect(dojo)

I am trying to get values ​​from memory. I can see filteringselect

on my page, but it returns nothing and firebug keeps saying that store.fetch is not a function

Below is a code snippet. Any hints?

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");

      

Sincerely.

+3


source to share


2 answers


store: dojo.data.ObjectStore({ objectStore:store1})

it worked for me ..



+1


source


dojo.store.Memory is using the new store API and FilteringSelect is trying to access it with the old API (fetch).

You can try using the dojo.store.DataStore adapter to pass the new style store to what the old interface expects.



new dijit.form.FilteringSelect({
    //...
    store: dojo.store.DataStore(store1)
});

      

+5


source







All Articles