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

Need a Change event when first load using datasource

2 Answers 733 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 17 Apr 2012, 11:55 PM
I am loading a dropdownlist from a datasource but wish to trigger another action when the first item is selected but I do not seem to be able to get Kendo to trigger a change event?

The change fires OK when I actually select another item (as expected) but I would like an initial change event to be fired.

Leaving out the index it does load OK and appear to select the first item OK but I do not get any event.

Any ideas on how this can be done?

2 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 18 Apr 2012, 11:55 AM
Hello John,

 
The described behavior is expected as all HTML inputs elements does not raise change event when its value is set with JavaScript. You can achieve your goal with wiring the change event of the DataSource and do the required stuff:

var dropdownlist = $("#ddl").kendoDropDownList({
....
}).data("kendoDropDownList");
 
dropdownlist.dataSource.one("change", function() {
//event handled will be called only once.
});
All the best,
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
Vadivel
Top achievements
Rank 1
answered on 20 Apr 2012, 06:35 AM
how to value is set with JavaScript and call to our kendo script
Tags
DropDownList
Asked by
John
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Vadivel
Top achievements
Rank 1
Share this question
or