如何在Dojo中从Checked MultiSelect(“dojox.form.CheckedMultiSelect”)中选择一个选项时编写条件?

4sup72z8  于 2022-12-08  发布在  Dojo
关注(0)|答案(1)|浏览(144)

我需要编写代码,根据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);

}

c86crjj0

c86crjj01#

var opt = this.mslt.getOptions();
if (opt[1].selected) {
    //Statement
}

相关问题