我想我得到它的工作[工作撥弄] [1]
[1]: http://jsfiddle.net/qpue91L9/125/
同樣的建議,提供了完整的工作代碼
HTML代碼
<input id="stateSelect">
<input id="stateSelect1">
<input id="stateSelect2">
JS代碼
require([
"dojo/store/Memory", "dojo/on","dijit/form/FilteringSelect", "dojo/domReady!",'dijit/registry',"dijit/focus","dojo/dom"
], function(Memory, on,FilteringSelect,ready,registry,focusUtil,dom){
var stateStore = new Memory({
data: [
{name:"Alabama", id:"AL", timeStamp:"1211753600"},
{name:"Alaska", id:"AK", timeStamp:"1211753601"},
{name:"American Samoa", id:"AS", timeStamp:"1211753602"},
{name:"Arizona", id:"AZ", timeStamp:"1211753603"},
{name:"Arkansas", id:"AR", timeStamp:"1211753604"},
{name:"Armed Forces Europe", id:"AE", timeStamp:"1211753605"},
{name:"Armed Forces Pacific", id:"AP", timeStamp:"1211753606"},
{name:"Armed Forces the Americas", id:"AA", timeStamp:"1211753607"},
{name:"California", id:"CA", timeStamp:"1211753608"},
{name:"Colorado", id:"CO", timeStamp:"1211753609"},
{name:"Connecticut", id:"CT", timeStamp:"1211753610"},
{name:"Delaware", id:"DE", timeStamp:"1211753611"}
], idProperty: "timeStamp"
});
var filteringSelect = new FilteringSelect({
id: "stateSelect",
store: stateStore,
tabIndex: 1,
searchAttr: "name",
identifier: "timeStamp",
}, "stateSelect").startup();
var filteringSelect1 = new FilteringSelect({
id: "stateSelect1",
name: "state",
tabIndex: 2,
store: stateStore,
searchAttr: "name",
identifier: "timeStamp" ,
disabled:true,
}, "stateSelect1").startup();
var filteringSelect2 = new FilteringSelect({
id: "stateSelect2",
name: "state",
tabIndex: 3,
store: stateStore,
searchAttr: "name",
identifier: "timeStamp",
disabled:true,
}, "stateSelect2").startup();
on(dijit.byId("stateSelect"),"KeyPress",function(evt){
dijit.byId("stateSelect1").set("disabled",false);
});
on(dijit.byId("stateSelect"),"change",function(evt){
dijit.byId("stateSelect1").set("disabled",false);
dijit.byId("stateSelect1").focus();
});
on(dijit.byId("stateSelect1"),"KeyPress",function(evt){
dijit.byId("stateSelect2").set("disabled",false);
});
on(dijit.byId("stateSelect1"),"change",function(evt){
dijit.byId("stateSelect2").set("disabled",false);
dijit.byId("stateSelect2").focus();
});
});
這裏沒有看到問題。在你的小提琴中,從第一個下拉列表中選擇一些東西后,我選擇第二個下拉列表,然後立即開始輸入或使用向上/向下箭頭滾動選擇(不需要點擊)。你使用的是什麼瀏覽器??我嘗試了它在Firefox中,它的工作。 – GoinOff
@ GoinOff,我就是這麼做的。將鼠標光標放在第一個過濾選擇上,然後鍵入'A'。立即,您會看到所有狀態都以字母「A」開頭,默認情況下,「阿拉巴馬」會突出顯示並顯示在文本框中。現在按tab鍵,控制轉到下一個Filteringselect,除非您在該過濾選擇上單擊鼠標,否則不能輸入任何內容。 –