jQWidgets Forums
jQuery UI Widgets › Forums › Lists › ComboBox › jqxcombobox change event firing twice
Tagged: combobox, jqxComboBox
This topic contains 5 replies, has 2 voices, and was last updated by Peter Stoev 8 years, 2 months ago.
-
Author
-
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.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 StoevjQWidgets Team
http://www.jqwidgets.comThanks 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(); } });
I see no problem about it. You should handle only with “args”.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comI 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.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 StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.