当从Dojo中的Checked Multi Select(“ dojox.form.CheckedMultiSelect”)中选择一个选项时如何写条件?

问题描述 投票:0回答:1

我需要编写代码来对列表执行某些操作,具体取决于从Dojo中的Checked Multi Select(“ dojox.form.CheckedMultiSelect”)中选择的选项。在dojo中选择一个(或多个)选项时,如何编写条件?

<select multiple="true" name="multiselect" data-dojo-type="dojox.form.CheckedMultiSelect" data-dojo- 
 attach-point="mslt" dropDown="true"> 
    <option value="one" selected="selected" data-dojo-attach-point="chkWQT">Option-1</option>
    <option value="two" selected="selected" data-dojo-attach-point="chkWQL">Option-2</option>
</select>

Javascript:

if (//Option-1 is selected) {
  layerList.push.apply(List, Resources_GRP);

}

javascript dojo
1个回答
0
投票
var opt = this.mslt.getOptions();
if (opt[1].selected) {
    //Statement
}
© www.soinside.com 2019 - 2024. All rights reserved.