简体   繁体   English

Jquery 自动完成 - 自动提示插件问题

[英]Jquery Autocomplete - autosuggest plugin problem

I using this plugin http://code.drewwilson.com/entry/autosuggest-jquery-plugin While typing "MAS" there is no data matched, so its displaying "NO data found", but at the same time if i press tab key "MAS" with delete symbol appearing in my text field..我使用这个插件http://code.drewwilson.com/entry/autosuggest-jquery-plugin在输入“MAS”时没有匹配的数据,所以它显示“未找到数据”,但同时如果我按 Tab带有删除符号的键“MAS”出现在我的文本字段中..

any solution for this任何解决方案

That particular plugin supports "tabbing" to use multiple user selection choices.该特定插件支持“选项卡”以使用多个用户选择选项。

If you are looking for plain auto-complete plugin.如果您正在寻找简单的自动完成插件。 try尝试

a) Use a different plugin - google it, tons of them, also here's a link to an answer https://stackoverflow.com/questions/188442/whats-a-good-ajax-autocomplete-plugin-for-jquery a)使用不同的插件 - 谷歌它,很多,还有一个链接到答案https://stackoverflow.com/questions/188442/whats-a-good-ajax-autocomplete-plugin-for-jquery

b) Remove the tab key handler from that plugin. b) 从该插件中删除 tab 键处理程序。 Download the plugin and remove the tab handler.下载插件并删除选项卡处理程序。 or as the documentation says http://code.drewwilson.com/entry/autosuggest-jquery-plugin ;或如文档所述 http://code.drewwilson.com/entry/autosuggest-jquery-plugin try writing your own event handlers for尝试编写自己的事件处理程序

selectionAdded : callback function - Custom function that is run when a selection is made by choosing one from the Results dropdown, or by using the tab/comma keys to add one. selectionAdded : 回调 function - 自定义 function 在通过从结果下拉列表中选择一个或使用制表符/逗号键添加一个进行选择时运行。 The selection item is passed into this callback function as 'elem'.选择项作为“elem”传递到此回调 function。 Example: selectionAdded: function(elem){ elem.fadeTo("slow", 0.33);示例: selectionAdded: function(elem){ elem.fadeTo("slow", 0.33); } }

selectionRemoved : callback function - Custom function that is run when a selection removed from the AutoSuggest by using the delete key or by clicking the "x" inside the selection. selectionRemoved : 回调 function - 自定义 function 在使用删除键或单击选择内的“x”从 AutoSuggest 中删除选择时运行。 The selection item is passed into this callback function as 'elem'.选择项作为“elem”传递到此回调 function。 Example: selectionRemoved: function(elem){ elem.fadeTo("fast", 0, function(){ elem.remove(); });示例: selectionRemoved: function(elem){ elem.fadeTo("fast", 0, function(){ elem.remove(); }); } }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM