无法从meter_Select 填充card_Select。每次更改meter_Select时,我都使用set方法设置和存储。
请参阅我的代码如下:-
var store = new Memory({
data:[
{id:'', label:"Choose one of the cards"},
{id:'testdata1970_05', label:"Mk7ABC Card"},
{id:'testdata1970_10', label:"Mk7CBC Card"},
{id:'testdata2060_03', label:"Mk10BC Card"},
]});
var memoStore1 = new ObjectStore({objectStore:store});
var meter_Select = new Select
({store:memoStore1,
style:{width:'140px'},
}, "node_meterSelect");
meter_Select.startup();
var card_Select = new Select
({style:{position: 'absolute', margin: '20px', left:'60px', width:'140px'},
id:'cardSelect'
}, "node_cardSelect");
on(meter_Select, 'change', function(evt)
console.debug('Selected Card = '+ meter_Select.value);
request.post('listofcards.php',{data:{cardX : meter_Select.value},
handleAs:"json"}).then(
function(response)
{var memoStore2 = new Memory({data:response});//ok
console.debug("Loaded into memoStore2 ->" +memoStore2);
var combx = registry.byId('cardSelect');//ok to be undefined.
combx.set('store', memoStore2);
combx.set('value',"");
combx.set('placeHolder',"Choose one of the batch...");
combx.set('searchAttr', 'mfg_code');
combx.startup();
},//function(response)
function(error)//ok
alert('Getting a list of cards = '+error);
}//function(error)
)//then.});//meter_Select.on
任何的想法?克莱门特