使用 JQuery 链接动态创建的下拉菜单
我正在为应用程序构建某种不确定的过滤器,当我克隆一些选择时,我遇到了这个问题。
事情是这个选择通过 Chained Selects jQuery 插件在它们之间链接起来。
问题是,每次我克隆选择时,链接都会停止工作,并且我已经尝试了一切,例如 .live() 来使其工作,但似乎我运气不好:D
这里有一个示例我正在谈论的内容, http://jsfiddle.net/7K2Eu/63/
首先,选择链正常,但是当我克隆表单时,除了第一行选择之外,它们停止工作。
谢谢你!!
I'm building some kind of indefinite filters for an app, and I'm havin this problem when I clone some selects.
The things is this selects are chained between them, trough the Chained Selects jQuery plugin.
The problem is that every time I clone the selects, the chaining stops working, and I've tryed everything, such as .live() to make it work, but it seems I'm out of luck :D
Here you have a sample of what I'm talking about, http://jsfiddle.net/7K2Eu/63/
At first, the selects chain normally, but when I clone the form, they stop working, except for the first row of selects.
Thank you!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
http://jsfiddle.net/FJFFJ/1/ 我想这就是你搜索的内容;-)
我发现当您克隆模板时,您只能克隆当前现有的模板。因此,如果您做出了一些选择,因此链接减少了选择集,您仅克隆该减少的选择集。
我还发现克隆并不能克隆链接。
此外,我还更改了您的复制支持,以便仅将链接应用于新生成的项目。
http://jsfiddle.net/FJFFJ/1/ i think this is what you search ;-)
I figured out that when you do the clone of the template you only clone the current existing template. thus if you made some choices and therefore the chaining reduced the set of selections you clone only that reduced set of selections.
I also figured out that cloning doesn't clone the chaining.
Also I changed your duplication support so that the chaining only is being applied to the new generated items.
嗯...似乎有点过于复杂...
这是另一个例子
Hmz... seems a bit overly complicated...
Here's another example