I am trying to populate a ComboBox dynamically in dojo. I have declared it in html and I am trying to created the Memory store in js and then setting the store attribute for the ComboBox with that value of store which I am creating in js. Here are my html and javascript files. I am calling a function in js which get a json response(item) as its argument and in that response values are coming(ResultData1,ResultData2,ResultData3) I have tested that by keeping alert boxes. But when running this page i am getting TypeError: Memory is not a constructor error. Can someone please explain me what i am doing wrong.
FYI: I have added all the required dependency list in my js file.
HTML:
<select data-dojo-type="dijit/form/ComboBox" data-dojo-attach-point="importDocumentTo" id="importDocumentTo" name="importDocumentTo">
JavaScript:
_onPopulate : function(item) {
alert('_onPopulate:');
var combo = dijit.byId('importDocumentTo');
alert('combo' + combo)
var stateStore=new Memory({
data: [
{name:item["ResultData1"], id:"data1"},
{name:item["ResultData2"], id:"data2"},
{name:item["ResultData3"], id:"data3"}
]
});
alert('stateStore:' + stateStore);
var result=domAttr.set("importDocumentTo","store",stateStore);