我在测试文件中有以下内容。我正在尝试将过滤选择中的选定值写入除法。第一次它工作正常,但下一次过滤没有发生(下拉列表中没有可用的值)。对于第一次更改过滤选择,成功调用 onchange。
请帮助我找到问题。我是道场新手。DOJO 版本 - DOJO 1.8
<script>
require([
"dojo/store/Memory", "dijit/form/FilteringSelect", "dojo/domReady!"
], function(Memory, FilteringSelect){
var stateStore = new Memory({
data: [
{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 filteringSelect = new FilteringSelect({
id: "stateSelect",
name: "state",
placeHolder: "Select a State",
store: stateStore,
searchAttr: "name",
onChange: function(value) {
var text1 = document.getElementById("divid").innerHTML
document.getElementById("divid").innerHTML = text1 + dijit.byId('stateSelect').attr('displayedValue') + ';';
}
}, "stateSelect");
});
</script>
<div id="divid">
Select a State : <input id="stateSelect">
</div>