This is a migrated thread and some comments may be shown as answers.

Change not triggered if selection change via value method

13 Answers 1259 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 1
Joel asked on 24 Feb 2012, 04:17 PM
Sample jsFiddle here: http://jsfiddle.net/latenightcoder/R4mKu/3/ 

Try selecting a new option and then canceling when the confirm dialog pops up. (This sets it back to the old value using the value method). Now, try selecting a new option and the change event doesn't trigger.

13 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 28 Feb 2012, 05:14 PM
Hello Joel,

 
This is a known issue, which is already addressed and the fix will be available in the next official release of Kendo UI. You can check the Beta of the Kendo UI scheduled for the begging of the March.

Kind regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Joel
Top achievements
Rank 1
answered on 28 Feb 2012, 08:14 PM
Did not see this fix in the current internal build - kendoui.web-dataviz.2011.3.1413

Any chance a new internal build will be posted soon?
0
Georgi Krustev
Telerik team
answered on 29 Feb 2012, 10:44 AM
Hello Joel,

The fix will be introduced in the Beta release of the Kendo UI scheduled for the beginning of the March.  

Greetings,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Dustin
Top achievements
Rank 1
answered on 22 Mar 2012, 09:33 PM
This is still an issue in the offical release of Q1. I'm setting the value using the method and it changes, but the change event still does not fire unless I select it through the UI.
0
Dustin
Top achievements
Rank 1
answered on 22 Mar 2012, 09:40 PM
This is still an issue in the offical release of Q1. I'm setting the value using the method and it changes, but the change event still does not fire unless I select it through the UI.
0
Joel
Top achievements
Rank 1
answered on 23 Mar 2012, 06:22 AM
Dustin, seems like it is fixed. I updated the jsFiddle to use bits from today's release: http://jsfiddle.net/latenightcoder/R4mKu/7/ 
0
Dustin
Top achievements
Rank 1
answered on 23 Mar 2012, 02:30 PM
Here is a link to my forked version. The drop down wont even open in IE9, so I had to use Firefox. But, in my version I changed it so that if the value changes you willget a alert and in the jquery document.ready event I change the value to the second item using the value method and the change event never fires.

http://jsfiddle.net/djarekg/W7nrM/
0
Joel
Top achievements
Rank 1
answered on 23 Mar 2012, 04:31 PM
Ah, Dustin ... good catch but I wonder how valid a use-case that is. In our app (and in most), I would expect changes to come out of user-interaction (mouse / keyboard) with the control and this release does fix that scenario.
0
Dustin
Top achievements
Rank 1
answered on 23 Mar 2012, 04:34 PM
But say you have cascading drop downs and one or more of those values are preset based on certain senarios or user profile properties. If any of these drop downs values are then set programmically, the change events won't fire to tell the dependent drop downs to update.
0
Bobby
Top achievements
Rank 1
answered on 29 Apr 2012, 08:35 PM
Is there any workaround, or hopefully, a fix coming for this issue?  I have a screen that displays data based on what is selected in a drop down, but need this data to display based on the initial value set in the database, and this is done through the value() method of the drop down.  The change event doesn't fire until the drop down is used by the user.  This seems like a common scenario, I'm having a hard time understanding how this was overlooked?

The only way around this I have found so far is to call the code that would be called from the change event immediately after calling the value() method; however, even this doesn't work without setting a delay of around 500 ms.  Needless to say, this is not the way I'd prefer to code this.
0
Richard
Top achievements
Rank 1
answered on 01 May 2012, 05:30 PM
Dustin:

I'm in the same boat as you.  With 1.322 the programmatic use of the select() method does not fire a select or change event.

http://jsfiddle.net/RichardAD/HpKgq/
0
Georgi Krustev
Telerik team
answered on 02 May 2012, 02:25 PM
Hello,

 
The ComboBox, as other input widgets, does not raise change event when the value is set by the API. This is the default behavior of the INPUT element. The change event should be raised only if the value is modified by the end-user. If you need to trigger change event you can use trigger("change"). Check the modified jsFiddle demo.

Kind regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Richard
Top achievements
Rank 1
answered on 02 May 2012, 02:36 PM
Thanks Georgi.

I understand how adherence to standards is important, but so is expectations of developers using rich interface components.  For the suggestion box, consider adding a configuration option such as changeOn: user|any or at least document change event and select method so that we know to manual trigger change when programmatically selecting.
Tags
DropDownList
Asked by
Joel
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Joel
Top achievements
Rank 1
Dustin
Top achievements
Rank 1
Bobby
Top achievements
Rank 1
Richard
Top achievements
Rank 1
Share this question
or