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

Avoid triggering change event during initialization #4

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

interlee
Copy link

The switch triggers change event during initialization, which can be tricky to handle if we were to use the change event for invoking ajax for updating the changed value. So, the change event won't get called during the initialization.

interlee and others added 7 commits August 28, 2013 16:34
…back). Pubic method:isChecked, readOnly

*** Options Added ***
font_size: 10,              // Set the label font-size. Added by Daniel Lee
read_only: false,           // Set to readonly mode if true. Added by Daniel Lee
init: function() {},        // callback function for initialization Added by Daniel Lee
on_toggle: function() {}   // callback function for initialization Added by Daniel Lee

*** Public Methods Added ***
// Check the value of the current status
isChecked: function()

// Set/Unset read only
readOnly: function(value)
The switch triggers change event during initialization, which can be tricky to handle if we were to use the change event for invoking ajax for updating the changed value. So, the change event won't get called during the initialization.
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

Successfully merging this pull request may close these issues.

2 participants