JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="http://www.bootstrap-switch.org/dist/js/bootstrap-switch.js"></script>
<link rel="stylesheet" href="http://www.bootstrap-switch.org/dist/css/bootstrap3/bootstrap-switch.css">
<table class="table">
<tbody id="container">
<tr class="nome-form">
<td><input type="checkbox" name="chk-teste"/><td>
<td><button class='btn-add btn btn-primary' value='+'><span class='glyphicon glyphicon-plus' aria-hidden='true'></span> </button><td>
</tr>
</tbody>
</table>
JavaScript
var ativador = function () { $(this).bootstrapSwitch({}); };
var acao = function() {
var campo = this;
if (campo.value == "+") {
var tr = campo.parentNode.parentNode;
var novoTr = tr.cloneNode(true);
var botoesNovos = novoTr.getElementsByClassName('btn-add');
// Remove o DIV do checkbox bootstrap (pode dar blink na tela)
$(novoTr).find('div').remove();
// Adiciona um checkbox "puro"
var $novoCheck = $('<input>', {
"type": 'checkbox',
"data-widget": 'bootstrap-switch'
});
$('td:first', $(novoTr)).append($novoCheck);
// Transforma o checkbox em bootstrap-switch
ativador.apply($novoCheck);
for(var i=0;i<botoesNovos.length;i++){
botoesNovos[i].addEventListener('click', acao, false);
}
tr.parentNode.insertBefore(novoTr, tr.nextSibling);
}
};
function adiciona() {
var botoes = document.getElementsByClassName("btn-add");
for(var i=0;i<botoes.length;i++){
botoes[i].addEventListener('click', acao, false);
}
}
$(document).ready(function(){
adiciona();
$("[name='chk-teste']").bootstrapSwitch();
});