查询自动补全
来源:互联网 发布:php 伪静态 编辑:程序博客网 时间:2024/04/27 14:36
jquery.autocomplete.css
jquery.autocomplete.js
$.ajax({
// try to leverage ajaxQueue plugin to abort previous requests
mode: "abort",
// limit abortion to this input
port: "autocomplete" + input.name,
dataType: options.dataType,
url: options.url,
data: $.extend({
q: lastWord(new Base64().encode(term)),
p: autocompleteCId,
limit: options.max
}, extraParams),
success: function(data) {
var parsed = options.parse && options.parse(data) || parse(data);
cache.add(term, parsed);
success(term, parsed);
}
});
@RequestMapping(value ="/getCsResultByQueryName",method = RequestMethod.GET)
public ResponseEntity<List<xxxx>> getCsResultByQueryName(@RequestParam(value="q") String khName,@RequestParam(value="p") Long communityId){
List<xxxx> propertyList = new ArrayList<xxxx>();
if(!"".equals(khName)){
String queryName =Base64.decode(khName,"utf-8");
queryName = SqlParameterUtil.convertLikeParameter(queryName);
if(communityId != null){
propertyList = housesPropertyService.getHousesPropertyByQueryName(communityId, queryName,null);
}
}
return new ResponseEntity<List<xxxx>>(housesPropertyList, HttpStatus.OK);
}
//查询自动补全
$("#productName").autocomplete("${ctx}/bu/activitie/getResultByQueryName", {minChars: 0,
max: 20,
autoFill: false,
mustMatch: true,
dataType: 'json',
matchContains: false,
scrollHeight: 'auto',
parse: function(data) {
var rows = new Array();
for (var i = 0; i < data.length; i++) {
rows[i] = { data: data[i], value: data[i].productName+data[i].userName, result: data[i].productName};
}
return rows;
},
formatItem: function(row, i, total) {
return row.productName+" ("+row.userName+")";
}
}).result(function(e, row) {
$("#phoneNumber").val(row.phoneNumber);
$("#userName").val(row.userName);
$("#productNameMsg").text("");
$("#userNameMsg").text("");
$("#phoneNumberMsg").text("");
});
- 查询自动补全
- (8)查询和自动补全
- jquery.autoComplete文本框查询自动补全插件支持中文
- 自动补全
- jquery自动补全
- 自动补全
- vim自动补全
- vim 自动补全
- vim自动补全
- Combobox 自动补全
- javaScript自动补全
- 自动补全
- 自动补全2
- new自动补全
- apt自动补全
- 代码自动补全
- vim 自动补全
- jQuery 自动补全
- .NET调用百度天气api经验
- x86+NFV 中国电信成功构建中国首个IP智能管道
- DTP模型及中间件的作用
- Redis笔记(三)添加密码并修改默认端口后的主从同步
- virtualbox 不能为虚拟电脑 打开一个新任务
- 查询自动补全
- hostapd 编译
- 【Servlet】利用JSTL表达式把Servlet从数据库读出的数据推向前台与javax.el.PropertyNotFoundException的错误
- 黑马程序员——Java基础---类加载器
- UIView 简介(一)ios 显示图层的层次框架
- BI与BA的区别及联系 .
- kafka api 开发常忽略的事
- Matcher: find vs matches
- 让Static控件活起来