jquery ui自动完成委托 [英] jquery ui autocomplete with delegate

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

问题描述

我已经根据文档设置了JQuery UI自动完成,它适用于渲染到页面的class =tag-item的任何输入。然而,用户可以通过JS将输入添加到dom中,因此我需要一种使用委托将自动完成绑定到新的动态创建的输入的方法。我不知道如何设置这个,任何想法都将不胜感激。

I have set up JQuery UI autocomplete according to the docs and it works for any input with class="tag-item" that is rendered to the page. However the user can add inputs into the dom via JS so I need a way to bind autocomplete to the new dynamically created inputs using delegate. I am not sure how to set this up, any ideas would be appreciated.

谢谢

推荐答案

您可以委派一个focusin事件设置输入字段。

You could delegate with a 'focusin' event to setup your input field.

看到这篇文章

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

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