I am trying to clone a row which contains select2 tool ,when i clone that row using jQuery the cloned select2 is not responding.In image given below first select2 which is o
I faced the same problem, while trying to add a row to a table dynamically. (the row contains more than one select2 instance.)
I solved it in this way:
function addrow()
{
var row = $("#table1 tr:last");
row.find(".select2").each(function(index)
{
$(this).select2('destroy');
});
var newrow = row.clone();
$("#table1").append(newrow);
$("select.select2").select2();
}
The trick was that you need to destroy all the instances of .select2 separately and before cloning the row. And then after cloning, re-initialize the .select2. I hope this will work for others as well.