jquery.repeater

jQuery form repeater and select2 dont work together

£可爱£侵袭症+ 提交于 2019-12-23 04:09:36
问题 I am using Select2 and jQuery form repeater (https://github.com/DubFriend/jquery.repeater) I have searched on google/so for 2 days, but cant seem to get it to work. include jquery/select2.js/jquery.repeater.js var form = $('#form'); form.find('select').select2(); form.repeater({ show: function () { $(this).show(function(){ form.find('select').select2('destroy').select2(); }); }, hide: function (remove) { $(this).hide(remove); } }); The problem is the jQuery.repeater clones the div tag in

jQuery form repeater and select2 dont work together

可紊 提交于 2019-12-06 16:22:02
I am using Select2 and jQuery form repeater ( https://github.com/DubFriend/jquery.repeater ) I have searched on google/so for 2 days, but cant seem to get it to work. include jquery/select2.js/jquery.repeater.js var form = $('#form'); form.find('select').select2(); form.repeater({ show: function () { $(this).show(function(){ form.find('select').select2('destroy').select2(); }); }, hide: function (remove) { $(this).hide(remove); } }); The problem is the jQuery.repeater clones the div tag in which the input and select elements are when select2 is already initialized and has already changed the