jQWidgets Forums

jQuery UI Widgets Forums Lists ComboBox jqxcombobox change event firing twice

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

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • jqxcombobox change event firing twice #91314

    milind
    Participant

    jqxcombobox change event is firing twice and second time the event.args doesn’t get value..
    e.g. In dynamically binded combobox for Country, if I enter ‘I’ it selects first country with ‘I’. If press enter key then it shows the selected country in the combobox, but on tab key press, the event.args gets value false/undefined and combobox gets cleared (as we are clearing it in the else of if(args))..
    Request you to please let us know at the earliest, what is wrong. Thanks.

    jqxcombobox change event firing twice #91317

    Peter Stoev
    Keymaster

    Hi milind,

    Check for args when you handle the ComboBox’s change event. The other call is from the default INPUT HTML Element.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    jqxcombobox change event firing twice #91330

    milind
    Participant

    Thanks Peter for your reply.

    We are already checking for args in ComboBox’s change event. First time we get correct value but second time we are getting undefined and args is false and so goes into else part clearing the combobox value. Can we restrict the second call?
    e.g.

                $('#cmbState').on('change', function (event) {
                    var hidStateId = document.getElementById("hidStateId");
                    var args = event.args;
                    if (args) {
                        var item = args.item;
                        var value = item.value;
                        hidStateId.value = value;
                    }
                    else {
                        hidStateId.value = '';
                        $("#errNotification").jqxNotification({ width: 270 });
                        $("#errNotificationmsg").text("State does not exist");
                        $("#errNotification").jqxNotification("open");
                        $("#cmbState").val('');
                        $("#cmbState input").focus();
                    }
                });
    
    jqxcombobox change event firing twice #91335

    Peter Stoev
    Keymaster

    I see no problem about it. You should handle only with “args”.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    jqxcombobox change event firing twice #91379

    milind
    Participant

    I think the above mentioned issue is browser dependent. We are having this issue in Google Chrome Version 56.0.2924.87. But in it’s previous version 55.. it was working properly. In Firefox too we are having the same issue but in Safari it is working properly.
    Thanks.

    jqxcombobox change event firing twice #91398

    Peter Stoev
    Keymaster

    Hi milind,

    It’s not browser related. This was and always been the situation with this event. You should check for event.args to see whether it’s raised by jqxComboBox or it’s raise by INPUT HTML Element and you should process it only when event.args is defined.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.