在输入框输入关键字,下方显示联想的数据
只需要关心后台传的是List
$("#create-customerName").typeahead({
source: function (query, process) {
$.get(
"workbench/transaction/getCustomerName.do",
{ "name" : query },
function (data) {
//alert(data);
process(data);
},
"json"
);
},
delay: 1500
});
注意:
(1)后台查客户名字即可List<String>
(2)将浏览器默认提示关闭autocomplete="off"