<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<script type="text/javascript">
$(function() {
document.getElementById("user_editForm_id").style.display ="none";
//地区 combobox 在onLoadSuccess里需要制定学校的Url 但是那时候学校控件还没初始化 所以在这里一开始就先初始化
$('#user_editForm_schoolName').combobox({
valueField:'id',
textField:'name',
editable:false,
required:true
});
});
</script>
<form id="user_editForm" method="post">
<table>
<tr>
<td><input id="user_editForm_id" name="id" type="text" readonly="readonly"
class="easyui-validatebox" data-options="required:true"
hidden="true" /></td>
</tr>
<tr>
<th>District:</th>
<td>
<input id="system_user_user_addForm_districtName" name="districtId" class="easyui-combobox"
data-options="
valueField: 'id',
textField: 'name',
required:true,
editable:false ,
url : '${pageContext.request.contextPath}/manage/district/getDistricts.do',
onSelect: function(rec){
var url1 = '${pageContext.request.contextPath}/manage/school/findSchoolByDistrictId.do?id='+rec.id;
$('#user_editForm_schoolName').combobox('reload', url1);
$('#user_editForm_schoolName').combobox('setValue','');
},
onLoadSuccess:function(){
var districtId= $('#system_user_user_addForm_districtName').combobox('getValue');
var url2='${pageContext.request.contextPath}/manage/school/findSchoolByDistrictId.do?id='+districtId;
$('#user_editForm_schoolName').combobox('reload', url2);
}
"/>
</td>
</tr>
<tr>
<th>School:</th>
<td>
<input id="user_editForm_schoolName" name="schoolId"/>
</td>
</tr>
</table>
</form>