Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

store.fetch is not a function (dojo)

I am trying to implement a filteringselect(dojo) I am trying to get the values from a memory store. I am able to see the filteringselect on my page but it is not returning any thing and firebug keeps saying that store.fetch is not a function

Below is the code snippet. Any clues?

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

Regards.

like image 849
Newbie Avatar asked Apr 27 '26 11:04

Newbie


2 Answers

dojo.store.Memory uses the new store API, while FilteringSelect is trying to access it with the old API (fetch).

You can try to use the dojo.store.DataStore adapter in order to pass a new style store to something that expects the old interface.

new dijit.form.FilteringSelect({
    //...
    store: dojo.store.DataStore(store1)
});
like image 198
hugomg Avatar answered Apr 29 '26 23:04

hugomg


store:dojo.data.ObjectStore({ objectStore:store1}) this worked for me..

like image 42
Newbie Avatar answered Apr 30 '26 00:04

Newbie



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!