Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renew Switchery #173

Open
MaxCode-fan opened this issue Oct 28, 2019 · 2 comments
Open

Renew Switchery #173

MaxCode-fan opened this issue Oct 28, 2019 · 2 comments

Comments

@MaxCode-fan
Copy link

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?

@liasica
Copy link

liasica commented Nov 23, 2019

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

@masterrjj24
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants