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

$("#DirectorLegalDocument").data("kendoDropDownList").bind("DirectorLegalDocumentChange", onChange);

2 Answers 103 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dina
Top achievements
Rank 1
Dina asked on 10 May 2017, 10:30 AM

I am trying to dynamically add change event to dropdownlist like

$("#ID").data("kendoDropDownList").bind("MyChangefunction", onChange);

but I get

Uncaught ReferenceError: onChange is not defined

what is onChange and where is defined?

2 Answers, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 12 May 2017, 02:33 PM
Hello Dima,

I have examined the code and noticed that the parameters for the bind() method are switched. The parameters are indeed two, but the first one is the name of the event and the second one is the function to be called. That's why an Uncaught ReferenceError: onChange is not defined is thrown, because JS is searching for function called "onChange" to be executed.

In the link bellow you can see a sample demo illustrating how you can attach an event after the widget is initialized.


If you would like additional information on the bind() method you will find the article below interesting.



Regards,
Georgi
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Dina
Top achievements
Rank 1
answered on 12 May 2017, 02:39 PM
Thnks!
Tags
General Discussions
Asked by
Dina
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Dina
Top achievements
Rank 1
Share this question
or