jQuery MiniUI 开发教程 表单控件 ComboBox:联动选择(十)

84483368 2012-10-16

ComboBox:联动选择

参考示例:ComboBox:联动选择

一:创建两个ComboBox

<span>部门</span>

<inputid="deptCombo"class="mini-combobox"style="width:150px;"textField="name"valueField="id"

onvaluechanged="onDeptChanged"url="../data/DataService.aspx?method=GetDepartments"

showNullItem="true"/>

<span>职位</span>

<inputid="positionCombo"class="mini-combobox"style="width:150px;"textField="name"valueField="id"/>

二:valuechanged加载第二个ComboBox

functiononDeptChanged(e){

varid=deptCombo.getValue();

positionCombo.setValue("");

varurl="../data/DataService.aspx?method=GetPositionsByDepartmenId&id="+id

positionCombo.setUrl(url);

}

相关推荐