使用easyui-combogrid自动搜索提示

1.页面内容

<select id="inputMenu" class="easyui-combogrid" style=" width: 200px;"></select>  
        <a type="button" class="easyui-linkbutton" id="openTab" href="#">打开菜单</a>

2.js部分

	$("#inputMenu").combogrid({
			prompt:'输入关键字后自动搜索',
			required:true,
			mode:'remote',
			url:getRequestPath('/resource/getCodeByInput'),
			idField: 'name',  
			textField: 'code',   
			editable:true,
			hasDownArrow:true,			
			onBeforeLoad: function(param){				
					var value = $("#inputMenu").combogrid('getValue');
					if(value!=null && value!=undefined && value!=''){
						param.tecode = value;
						return true;
					}else{
						$("#inputMenu").combogrid('hidePanel');
						return false;	
					}		
			},
			onSelect:function(data){
				$("#inputMenu").combogrid('setValue',data.code);
			},
			columns: [[    
	            {field:'code',title:'Code',width:80,sortable:true},    
	            {field:'name',title:'Name',width:120,sortable:true}    
			 ]]    
		});
java后台代码没有放上去,这是加载的远程数据,后台返回的值存在map中,以json数据格式显示

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值