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

3 posts, 0 answers
  1. Dima
    Dima avatar
    50 posts
    Member since:
    Feb 2012

    Posted 10 May 2017 Link to this post

    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. Georgi
    Admin
    Georgi avatar
    684 posts

    Posted 12 May 2017 Link to this post

    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.
  3. Dima
    Dima avatar
    50 posts
    Member since:
    Feb 2012

    Posted 12 May 2017 in reply to Georgi Link to this post

    Thnks!
Back to Top