使用easyui-combogrid自动搜索提示

1.页面内容

  
        打开菜单

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数据格式显示

 

你可能感兴趣的:(js)