开发者

linking ItemFileReadStore with FilteringSelect

开发者 https://www.devze.com 2023-03-17 08:44 出处:网络
dojo.addOnLoad(function(){ var jsonStore = new dojo.data.ItemFileReadStore({\"url\":\"http://localhos开发者_如何转开发t:8080/Sai/samu\"});
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>
0

精彩评论

暂无评论...
验证码 换一张
取 消