时间:2021-07-01 10:21:17 帮助过:164人阅读
下载,例子,文档地址
http://silviomoreto.github.io/bootstrap-select/
$("#goodsNames").selectpicker({}); //初始化 var s = ""; var timeOut = ""; $(".input-block-level").bind("propertychange input",function(event){ //添加input框事件 s = $(this).val(); clearTimeout(timeOut); timeOut = setTimeout(function(){ //设置延后ajax请求 var tempAjax = ""; $.ajax({ type : 'GET', url : '', dateType : 'json', data : "goodsName="+s, success: function(msg){ $.each(msg,function(i,n){ tempAjax += ""; }); $("#goodsNames").empty(); $("#goodsNames").append(tempAjax); //更新内容刷新到相应的位置 $('#goodsNames').selectpicker('render'); $('#goodsNames').selectpicker('refresh'); } }) },700); })