主要是构建
首先加载标签
<select name="intakname" id="cboRiverbasin" dojotype="dijit.form.FilteringSelect" style="width: 95px">
dojo.require("dijit.form.FilteringSelect");
dojo.require("dojo.data.ItemFileReadStore");
事件的代码如下
var dataItems = {
identifier: 'id',
label: 'id',
items: [
{ name: "Alabama", id: "AL" },
{ name: "Alaska", id: "AK" },
{ name: "American Samoa", id: "AS" },
{ name: "Arizona", id: "AZ" },
{ name: "Arkansas", id: "AR" },
{ name: "Armed Forces Europe", id: "AE" },
{ name: "Armed Forces Pacific", id: "AP" },
{ name: "Armed Forces the Americas", id: "AA" },
{ name: "California", id: "CA" },
{ name: "Colorado", id: "CO" },
{ name: "Connecticut", id: "CT" },
{ name: "Delaware", id: "DE" }
]
};
var store = new dojo.data.ItemFileReadStore({
data: dataItems
});
// this.widgets.intakname.values = ["fdfd", "sdfsdf"];
//this.widgets.intakname.set("searchAttr", "id");
dijibyId("cboRiverbasin").store = store; 或者dijibyId("cboRiverbasin").set("store",store)