首页 > 代码库 > jQuery easyUI 的combogrid进行模糊匹配
jQuery easyUI 的combogrid进行模糊匹配
$(function(){
$(‘#search_hospitalName‘).combogrid({
mode : ‘remote‘,//远程连接方式
//fitColumns:true,//自动大小
striped: true,
method:‘post‘,//请求方式
dataType:‘json‘,
panelWidth: 300,
url: ‘<%=basePath%>HospitalInfoAction/simpleQuery‘,
idField: ‘hospitalName‘,
textField: ‘hospitalName‘,
editable: true,
pagination: true,
//是否分页
columns: [[
{field: ‘id‘,title: ‘id‘,hidden: ‘true‘,align: ‘center‘},
{field: ‘hospitalName‘,title: ‘医院名称‘,width: 150,align: ‘center‘},
{field: ‘areaCode‘,title: ‘医院地区‘,width: 149,align: ‘center‘}
]],
keyHandler:{
up: function() {},
down: function() {},
enter: function() {},
query: function(q) {
//动态搜索
$(‘#search_hospitalName‘).combogrid("grid").datagrid("reload", {‘hospitalName‘: q});
$(‘#search_hospitalName‘).combogrid("setValue", q);
}
}
});
});
<td>就诊医院:</td>
<td>
<input id="search_hospitalName" name="hospitalName"class="easyui-combogrid"
onkeydown="if(event.keyCode==13)query()" style="width: 180px">
</td>
jQuery easyUI 的combogrid进行模糊匹配