开发者

linking ItemFileReadStore with FilteringSelect

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜