$(function(){
var stEventType = $('#stEventType').combobox({
url:'sub_template/code_json.jsp?type=EVENT_TYPE',
editable:false,
valueField:'tid',
textField:'text',
required:true,
onSelect:function(record){
stEventName.combobox({
url:'sub_template/code_json.jsp?type='+record.tid,
editable:false,
valueField:'tid',
textField:'text',
required:true
}).combobox('clear');
}
});
var sub_value = $('#stEventType').combobox('getValue');
if(sub_value==''){
sub_value='EVENT_TYPE_1';
}
var stEventName = $('#stEventName').combobox({
url:'sub_template/code_json.jsp?type='+sub_value,
editable:false,
valueField:'tid',
textField:'text',
required:true
});
$('#stDiscoverUnit').combobox({
editable:false,
url:'sub_template/unit_json.jsp?streetId=<%=(String)session.getAttribute("streetId")%>&typestr=1~2~-1',
valueField:'text',
required:true,
textField:'text'
});
$("#type_div").show();
$("#name_div").show();
});
<div id="type_div" style="display:none">
<input id="stEventType" type="text" style="width:155px" value=""/>
</div>
</td>
<td align="center" valign="middle" class="table_title" nowrap="nowrap" >
<font color="red">*</font>事件名称</td>
<td class="table_content">
<div id="name_div" style="display:none">
<input id="stEventName" type="text" style="width:155px" value=""/>
</div>
用于combobox的联动 div一般情况下是可以不需要的 这里加上主要是因为数据回显的时候js加载较慢 防止数据显示select value出来
此方法在项目中同一页面js过多的情况下会导致ie6崩溃
于是采用第二种方法
$(function(){
var type_select = $('#stEventType').combobox({
url:'sub_template/code_json.jsp?type=EVENT_TYPE',
editable:false,
valueField:'tid',
textField:'text',
onSelect:function(record){
$('#stEventName').combobox('clear');
$('#stEventName').combobox('reload','sub_template/code_json.jsp?type='+record.tid);
}
});
var sub_select = $('#stEventName').combobox({
disabled:false,
url:'sub_template/code_json.jsp?type=EVENT_TYPE_1',
valueField:'tid',
textField:'text'
});
});
分享到:
相关推荐
jquery-easyui组件combobox模糊查询在IE中数据太多导致浏览器崩溃
本文给大家分享jQuery EasyUI编辑DataGrid用combobox实现多级联动效果的实例代码,代码简单易懂,非常不错,具有参考借鉴价值,感兴趣的朋友一起看看吧
easyui-combobox控件的后台数据递归生成json,前台绑定实例说明。 可直接拷贝到项目中,然后修改数据源即可使用。
easyui中combobox后台交互实例
这是我自己总结出来easyui-textbox和easyui-combobox的onchange事件响应实例,绝对可用,网上很多实例都无法运行,这个我亲自测试可用使用才传上来的,供大家参考学习。
NULL 博文链接:https://wusuobuai.iteye.com/blog/1848724
创建easyui-combobox的方法,在easyUI的官网都有: 1、从带有预定义结构的 元素创建组合框(combobox) <select id=cc class=easyui-combobox name=dept style=width:200px;> <option value=aa>aitem1 ...
Easyui Combobox 过滤功能,类似火车票网站过滤。
主要介绍了EasyUI Combobox设置默认值 获取text的方法,非常不错,具有参考借鉴价值,需要的朋友可以参考下
easyui的datagrid中editor和combobox的级联,在datagrid中编辑项是下拉框的实现方式
java jquery easyui combobox 级联demo(真正可用) 注释详细
2018年最新的jquery, easyui, combobox ,mysql,数据库,省市县,三级联动
修改jquery easyui combobox模糊过滤 代码如下:filter:function(q,row){ var opts=$(this).combobox(“options”); //return row[opts.textField].indexOf(q)==0;// return row[opts.textField].indexOf(q)>-1;//将...
jquery Easyui 动态二级联动
使用方法 $(function () { //省市区三级联动 $.citySelect({ $province: $('#province'), $city: $('#city'), $County: $('#county') }); $('#ff').form('load', { 'province': '广东省', 'city': '深圳市', '...
easyUI各版本与ie浏览器兼容问题
主要为大家详细介绍了EasyUI学习之Combobox级联下拉列表的相关资料,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
修改上一个资源版本中结束编辑时combobox显示问题. 1、类型为combogrid时每行的参数不同查询返回对应的数据结果。 2、类型为combobox时,输入框显示图标按钮,实现对应的事件。 3、解决类型为combobox显示为value而...