jquery - Avoid "ifChanged" event handler when setting checkbox via Javascript -


For the ICheck plugin, is there a way to avoid setting fire to a "handset" event handler when setting up a checkbox from javascript? You can create a variable Change unchanged and subscribe to event handlers. However, you can check whether the variable is true and if so, set it to false and stop the function. If it is not correct , then you can execute your normal code.

JS Code:

  var ignoreChange = false; $ ('Input'). ('If changed', function (event) {if (change unchanged) {ignorechange = false; return;} // do stuff}); // When the checkbox changes ignore = change;   

Basically, whenever you set the variable Change unchanged to the correct, the next event call is ignored. It's quite a hack solution, though necessary, because i got no way to solve your problem iCheck library

Comments

Popular posts from this blog

c# - passing input text from view to contoller with FacebookContext using Facebook app -

ios - Does Core Data autoupdate a many to many relationship on saving -

Calling a C++ function from C# by passing a string with variable size to it -