下载,例子,文档地址 http://silviomoreto.github.io/bootstrap-select/
请选择团购商品 ${item.name}
$("#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 += " "+n.name+" "; }); $("#goodsNames").empty(); $("#goodsNames").append(tempAjax); //更新内容刷新到相应的位置 $('#goodsNames').selectpicker('render'); $('#goodsNames').selectpicker('refresh'); } }) },700); })
查看更多关于bootstrap-select使用的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did101406