jQuery UI Widgets Forums Editors CheckBox, RadioButton jqxcheckbox event.args.type is alway undefined

This topic contains 3 replies, has 2 voices, and was last updated by  Peter Stoev 3 years, 8 months ago.

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

  • Kalvin
    Participant

    Hi,

    I need to know how the check-state of the jqxCheckBox was changed. I looked up from the API and found the sample code below.

    var type = event.args.type; // keyboard, mouse or null depending on how the value was changed.});

    I tired it with the provided demo here. I added a jqxButton for changing check-state of the jqxCheckBox with its API. However, the event.args.type is always null either when the checkbox is clicked directly or when the jqxButton is clicked.

    Here is the modified demo code.

    <div id='jqxCheckBox'>Entertainment</div>
    <input type="button" value="Click me" id='jqxButton' />'
    
    

    $(“#jqxCheckBox”).jqxCheckBox({
    width: ‘300px’,
    height: 25,
    theme: ‘energyblue’
    });

    $(‘#jqxCheckBox’).on(‘change’, function (event) {
    var type = event.args.type;
    alert(“The state has been changed, change type is: ” + type);
    });

    $(‘#jqxButton’).jqxButton({
    theme: ‘energyblue’
    });
    $(‘#jqxButton’).on(‘click’, function () {
    $(‘#jqxCheckBox’).jqxCheckBox(‘uncheck’);
    });`

    Please help, did I miss anything?

    Thanks


    Peter Stoev
    Keymaster

    Hi Kalvin,

    Thank you for feedback. We will take a look at this.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/


    Kalvin
    Participant

    Hi Peter,

    While this issue is being investigated, is there other way to distinguish the sources of the change event between the direct keyboard/mouse input to the checkbox and the indirect API calls below?

    $(‘#jqxCheckBox’).jqxCheckBox(‘uncheck’);
    $(‘#jqxCheckBox’).jqxCheckBox(‘check’);

    Thanks


    Peter Stoev
    Keymaster

    Hi Kalvin,

    No. You can’t distinguish whether is comes from keyboard or mouse. It’s from API when you call a method so you can know only that.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.