switchery
switchery copied to clipboard
Renew Switchery
I have some problems when using it,I get a state in the database, and if it's off, I close it from the new rendering.
What should I do?
What is your problem? I do not understand.
TO LISTEN CHANGED VALUE, you'd refer this code from examples:
changeCheckbox.onchange = function() {
alert(changeCheckbox.checked);
};
I need a method to renew some checkbox. For example im using this code:
resetSwitcheryPiso: function() {
// uncheck some html checkbox
$('.por_piso .js-switch-piso').each(function(){
$(this).get(0).checked=false;
});
// delete elements plugin switchery
$('.por_piso .switchery').remove();
// Reload plugin switchery
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch-piso'));
elems.forEach(function (html) {
var switchery = new Switchery(html, {
size: 'small'
});
});
},
Please ¿Can you add a simple method for reload switchery plugin?