switchery icon indicating copy to clipboard operation
switchery copied to clipboard

Renew Switchery

Open MaxCode-fan opened this issue 5 years ago • 2 comments

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. image image What should I do?

MaxCode-fan avatar Oct 28 '19 09:10 MaxCode-fan

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);
};

liasica avatar Nov 23 '19 15:11 liasica

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?

masterrjj24 avatar Jul 06 '20 21:07 masterrjj24