Jquery Autocomplete - 自动建议插件问题
我使用这个插件 http://code.drewwilson.com/entry/autosuggest-jquery-plugin 输入“MAS”时没有匹配的数据,因此显示“未找到数据”,但同时 如果我按 Tab 键“MAS”,并且删除符号出现在我的文本字段中..
对此有任何解决方案
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..
any solution for this
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该特定插件支持“选项卡”以使用多个用户选择选项。
如果您正在寻找简单的自动完成插件。
尝试
a)使用不同的插件 - 谷歌它,大量的插件,这里还有一个答案的链接
https://stackoverflow.com/questions/188442/whats-a- good-ajax-autocomplete-plugin-for-jquery
b) 从该插件中删除 tab 键处理程序。下载插件并删除选项卡处理程序。
或如文档所述 http://code.drewwilson.com/entry/autosuggest-jquery -插件;尝试为
selectionAdded
编写自己的事件处理程序:回调函数 - 通过从“结果”下拉列表中选择一项或使用制表符/逗号键添加一项来进行选择时运行的自定义函数。选择项作为“elem”传递到此回调函数中。
示例:selectionAdded: function(elem){ elem.fadeTo("slow", 0.33);
selectionRemoved:回调函数 - 当使用删除键或单击所选内容内的“x”从 AutoSuggest 中删除所选内容时运行的自定义函数。选择项作为“elem”传递到此回调函数中。
示例:selectionRemoved: function(elem){ elem.fadeTo("fast", 0, function(){ elem.remove(); }); }
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
b) Remove the tab key handler from that plugin. Download the plugin and remove the tab handler.
or as the documentation says 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. The selection item is passed into this callback function as 'elem'.Example: 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. The selection item is passed into this callback function as 'elem'.Example: selectionRemoved: function(elem){ elem.fadeTo("fast", 0, function(){ elem.remove(); }); }