大佬教程收集整理的这篇文章主要介绍了jqueryui自动完成过滤器结果(来自远程数据源)“以”开头“输入,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我已经研究过,并在SO上找到了this answer,并希望将它与我的其余功能集成,但它不会更新结果列表.独立地,SO答案可以正常工作,但是当与多个结果和远程数据源集成时则不行.
.autocomplete({ source: function( request,response ) { $.ajax({ url: "/controller/MyFunction",dataType: "json",data: request,success: function(data){ if(data.response == 'true') { response(data.messagE); } } }); },
Possible solution on SO :(独立工作正常,但不能使用jquery / remote / multiple codE):
var wordlist= [ "about","above","within","without"]; $("#input1").autocomplete({ source: function(req,responseFn) { var re = $.ui.autocomplete.escapeRegex(req.term); var matcher = new RegExp( "^" + re,"i" ); var a = $.grep( wordlist,function(item,indeX){ return matcher.test(item); }); responseFn( a ); } });
$("#YOUR_TEXT_INPUT").autocomplete({ source: function(req,responsE) { $.ajax({ url: "/controller/MyFunction",success: function( data ) { var re = $.ui.autocomplete.escapeRegex(req.term); var matcher = new RegExp( "^" + re,"i" ); response($.grep(data,function(item){return matcher.test(item.value);}) ); } }); },minLength: 2,SELEct: function(event,ui) { //custom SELEct function if needed } });
以上是大佬教程为你收集整理的jqueryui自动完成过滤器结果(来自远程数据源)“以”开头“输入全部内容,希望文章能够帮你解决jqueryui自动完成过滤器结果(来自远程数据源)“以”开头“输入所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。