jQWidgets Forums

jQuery UI Widgets Forums Editors Button, RepeatButton, ToggleButton, LinkButton jqxSwitchButton – execute or not some code

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 11 years, 5 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • shardik
    Participant

    I’ve 2 control jqxSwitchButton
    $(‘#jqxSwitchButton1’).jqxSwitchButton({ height: 27, width: 81, theme: theme, checked: true });
    $(‘#jqxSwitchButton1’).bind(‘change’, function(event) {
    myFunction();
    });
    $(‘#jqxSwitchButton2’).jqxSwitchButton({ height: 27, width: 81, theme: theme, checked: true });
    $(‘#jqxSwitchButton2’).bind(‘change’, function(event) {
    myFunction();
    });

    The info on this 2 control are saved, when i take that info and i preload the value, the myfunction() is called 2 times
    can I set the value without call myFunction()?

    //preload
    $(‘#jqxSwitchButton1’).jqxSwitchButton({ checked: false });
    $(‘#jqxSwitchButton2’).jqxSwitchButton({ checked: false });
    Shardik


    Peter Stoev
    Keymaster

    Hi Shardik,

    “change” is raised when the “checked” property is changed”. If you change the “checked” property inside the “change” callback, then it is quite possible the callback to be called again.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.