这个是针对easyUI的下拉菜单使用的,Ajax获取远程数据源

HTML 页面

<input  />

JS代码

$("#uname").combobox({
		prompt:'输入首关键字自动检索',
	        valueField:'tDealerCodeDto',
	        textField:'tDealerCodeDto',
	        panelWidth:120,
	        panelHeight:'auto',
	        onChange:function(values,o){
	            if(values!=""){
	                var url='URL?name='+values.trim();
	                $("#uname").combobox("reload",url);
	            }
	        }
	    })

其中onchange函数的values参数为 控件input的输入value值, o参数具体的不清楚,因为已经可以实现下拉菜单了.但是通过打印知道该参数返回上一次input的输入值

部分后台代码

        @LoginCheck(description = true)
	@RequestMapping("queryName")
	@ResponseBody
	public List<TDealerDto> queryname(HttpServletRequest request, HttpServletResponse response,String name){
		List<TDealerDto> list= tcustomerService.queryName(name);
return list;
}

返回的实体中一定要包含combobox中显示的valueField和textField字段值

先介绍到这里..以后再补充

相关文章:

  • 2021-10-23
  • 2022-12-23
  • 2021-11-29
  • 2022-12-23
  • 2021-12-27
  • 2022-01-14
  • 2022-01-04
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-18
  • 2021-07-05
  • 2021-10-28
相关资源
相似解决方案