vendredi 9 janvier 2015

Bootstrap Data Table checkbox change class

I am using Bootstrap Data Table and want to remove a class to a button when a checkbox is checked and add a class if all checkboxes are unchecked.


What I am currently doing for checked:



.on('check.bs.table', function (e, row) {
$('#remove-user').removeClass('disabled');
})


This works good.


What I am doing for unchecked:



.on('uncheck.bs.table', function (e, row) {
$('#remove-user').addClass('disabled');
})


This also works but the problem that I am running into is when I have more than one checkbox checked as soon as I uncheck one of those boxes it adds the class disabled. I do not want to add the class disabled until all checkboxes have been unchecked. Does anyone have any suggestions on how to do this?





Aucun commentaire:

Enregistrer un commentaire