Jquery自动完成点击事件 [英] Jquery autocomplete click event

查看:98
本文介绍了Jquery自动完成点击事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。我有一个jquery自动完成ui的问题。当我在自动完成文本框中键入内容时,我将数据加载到表中。当用户从自动完成列表中选择一个选项时,表中的数据应该会发生变化,但这仅在我使用键盘选择选项时才有效,而不是在用鼠标单击选项时。我已经阅读了一些关于这个问题的文章但是无法理解它们,因为我是jquery的初学者。任何帮助将不胜感激,请提前感谢。



Hi all. I have a problem with the jquery autocomplete ui. When i type something in the autocomplete textbox i load data into a table. When the user selects an option from the autocomplete list the data in the table should change, however this is only working when i use the keyboard to select an option not when i click on the option with the mouse. I have read some articles on the problem but can't understand them as i am a beginner when it comes to jquery. Any help will be much appreciated, thanking you in advance.

$(function () {

                    $("#tags").autocomplete({
                        source: returned_arr
                    });
                });

推荐答案

(function(){
(function () {


(#tags)。autocomplete({
source:returned_arr
});
}) ;
("#tags").autocomplete({ source: returned_arr }); });


从朋友那里得到问题的答案。当您从自动选择中选择一个选项时,只需使用计时器执行您想要执行的功能。



Got the answer to the question from a friend. Just use a timer to execute the function you want to execute when you select an option from the auto-select.


这篇关于Jquery自动完成点击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆