dojo.addOnLoad(function(){
var jsonStore = new dojo.data.ItemFileReadStore({"url":"http://localhos开发者_如何转开发t:8080/Sai/samu"});
});
<div dojoType="dijit.form.FilteringSelect" store="jsonStore" required="true" id="MyId" ></div>
I am getting error stating as jsonStore not defined .
You are mixing programmatic and declarative Dojo approaches. You should use one or the other.
Programmatic:
dojo.addOnLoad(function(){
var jsonStore = new dojo.data.ItemFileReadStore({
url: "http://localhost:8080/Sai/samu"
});
var filtSel = new dijit.form.FilteringSelect(
{
id: "MyId",
store: jsonStore,
required: true
},
"MyId" // Id of div to turn into filteringSelect
);
});
...
<div id="MyId"></div>
Declarative
<div dojoType="dojo.data.ItemFileReadStore" jsId="jsonStore" url="http://localhost:8080/Sai/samu"></div>
<div dojoType="dijit.form.FilteringSelect" store="jsonStore" required="true" id="MyId" ></div>
精彩评论