0
我正在使用Kendo UI DropDownList插件。Kendo UI [kendoDropDownList] - OnSelect默认selcectbox值,动态更改其他选择框值
我有一个主选择框和一个副选框。如果我从主选择框中选择除 - 选择 - 选项以外的任何选项,则显示“子选择框”容器。
如果我来自主选择框选择Primary 1
,而不是从子选择框的值应该替换为
P1 Sub1 P1 Sub2 P1 Sub3
如果我选择Primary 2
,来自主选择框Default option 1...
,子选择框的值应该替换为
P2 Sub1 P2 Sub2 P2 Sub3
HTML
<select id="mainSelect" class="required">
<option>-- Select --</option>
<option>Primary 1</option>
<option>Primary 2</option>
</select>
<div id="ss-container" style="display:none;margin-top:20px;">
<select id="subSelect">
<option>Default option 1</option>
<option>Default option 2</option>
</select>
</div>
jQuery代码
jQuery("#mainSelect").kendoDropDownList({
select: function (e) {
var index = e.item.index();
if (index == 0) {
jQuery('#ss-container').hide();
}
else if (index == 1) {
jQuery('#ss-container').show();
}
else if (index == 2) {
jQuery('#ss-container').show();
}
else{
jQuery('#ss-container').hide();
}
}
});
jQuery("#subSelect").kendoDropDownList({});
任何建议吗?
你好** @弥敦道**优秀!!! ...这到底是什么我想。我要用Array方法去。我**接受**你的回答,并且太赞成了......继续努力工作:) – Reddy