JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.cs"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/1.8/js/bootstrap-switch.min.js"></script>
<link rel="stylesheet" href="http://www.bootstrap-switch.org/static/stylesheets/bootstrap-switch.css">
<!-- this is the global checkbox -->
<div class="make-switch switch-mini" id="rowSelectAll">
<input type="checkbox" id="rowSelectAllc">
</div>
<!-- row checkboxs -->
<div class="make-switch switch-mini toggle-state-switch">
<input type="checkbox" class="row-select">
</div>
<div class="make-switch switch-mini toggle-state-switch">
<input type="checkbox" class="row-select">
</div>
<div class="make-switch switch-mini toggle-state-switch">
<input type="checkbox" class="row-select">
</div>
JavaScript
/*$('#rowSelectAll').on('click', function(){
$val = $('#rowSelectAll').bootstrapSwitch('status');
$('.toggle-state-switch').each(function( index ) {
$(this).bootstrapSwitch('setState' , $val);
});
});*/
$('#rowSelectAll').on('switch-change', function (e, data) {
var $el = $(data.el)
, value = data.value;
$('.toggle-state-switch').each(function( index ) {
$(this).bootstrapSwitch('setState' , value);
});
});