jQuery-switchButton icon indicating copy to clipboard operation
jQuery-switchButton copied to clipboard

Triggering a Refresh

Open HoecusPocus opened this issue 12 years ago • 3 comments

Hi there,

I've got a form that hides in a jQuery Dialog, which I copy values to based on a click of an element in the page.

I set the value of the inputs (there is an input[type=checkbox] and a hidden - this is an MVC website) to have the checked / value=true, depending on the hidden fields of the clicked item.

However the switchButton doesn't seem to update / switch itself over when setting the underlying input field. Is there a way to trigger this?

Thanks, Ben

HoecusPocus avatar Nov 27 '13 14:11 HoecusPocus

I am need of this functionality as well. Is it possible to trigger a refresh?

My use case:

Switching the button triggers a dialog. If the user were to cancel the dialog I need to move the button back to its original position.

No idea how to do this though. Changing the :checked state underlying check box does not change the button..

ErwinM avatar Jan 24 '14 19:01 ErwinM

Guys, I'm sorry I don't remember having seen this issue at all :
Let me look at @ErwinM PR and I'll try to act quickly on it!

olance avatar Mar 20 '14 09:03 olance

Hi guys,

To change the state of :checked (for toggling between on and off label) you can use the class "switch-button-label off"

html snippet: <div id="switch-button-toggle"> <input type="checkbox" class="switch-button"/> </div>

js snippet: $("#switch-button-toggle [class='switch-button-label off']").click();

madhukumars17 avatar Dec 05 '17 09:12 madhukumars17