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.
事情就是这些选择被链接在它们之间,通过Chained选择jQuery插件。
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
问题是,每次我克隆选择,链接停止工作,我已经尝试了一切,如.live()使其工作,但似乎我运气不好:D
Here you have a sample of what I'm talking about, http://jsfiddle.net/7K2Eu/63/
在这里你有一个我正在谈论的样本,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!!
谢谢!!
2 个解决方案
#1
2
http://jsfiddle.net/FJFFJ/1/ i think this is what you search ;-)
http://jsfiddle.net/FJFFJ/1/我认为这是你搜索的内容;-)
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.
此外,我更改了您的复制支持,以便仅将链接应用于新生成的项目。
#1
2
http://jsfiddle.net/FJFFJ/1/ i think this is what you search ;-)
http://jsfiddle.net/FJFFJ/1/我认为这是你搜索的内容;-)
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.
此外,我更改了您的复制支持,以便仅将链接应用于新生成的项目。