Jquery - Advanced .clone()

被刻印的时光 ゝ 提交于 2019-12-10 11:48:31

问题


I started from here jQuery clone chained selects

The answers by Paulj

Version 1: http://jsfiddle.net/m4JTQ/2/

Version 2 (this is a modified version getting rid of the i iterator: http://jsfiddle.net/Zf7xb/1/

It works perfectly. But now im looking for more dificult.

The new scenario is:

----Group1 : [+] [-]-------------------------------

     ----Subgroup : [+] [-] ------------
       --Chile     | Santiago | Chiñihue
       --Argentina | San Juan | Rawson
       --Argentina | San Juan | Rawson (cloned)
     -----------------------------------

----------------------------------------------------

If i click at [+] on subgroup it will clone the last subgroup of this group.

If i click at [+] on group it will clone the last group with the last subgroup infos.

Ie:

----Group2 : [+] [-]-------------------------------

     ----Subgroup : [+] [-] ------------
       --Argentina | San Juan | Rawson (cloned)
     -----------------------------------

----------------------------------------------------

来源:https://stackoverflow.com/questions/12761534/jquery-advanced-clone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!