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

Switchery not rendered when loaded dinamically #169

Open
claracena opened this issue Jan 10, 2019 · 1 comment
Open

Switchery not rendered when loaded dinamically #169

claracena opened this issue Jan 10, 2019 · 1 comment

Comments

@claracena
Copy link

Hello,

I'm loading different sets of switches using AJAX + PHP depending on user selection using a select field. The problem is that when first loaded, the switches are not rendered using SWITCHERY. They just stay as simple checkboxes.

Sometimes the switches do get formatted with switchery but most of the time it doesn't.

The switches reside inside a table body and it's passed from PHP as a single line (from to ) and each line appended to the TBODY using a for loop inside the success function of AJAX.

Is there any way of re-dawing these switches after the loop?

Any ideas? Thanks!

@dysat
Copy link

dysat commented May 28, 2019

haz intentado hacer algo así

$.ajax({ url: "../../magics/magic_php/magic.php", method: "POST", data: DatosPeticionPermisos, cache: false, success: function(data) { $("#ListaPermisos").html(data); $('.js-switch-1').each(function() { new Switchery($(this)[0], $(this).data()); }); } });

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

2 participants