Events not firing properly

4 posts, 0 answers
  1. Dave
    Dave avatar
    35 posts
    Member since:
    Oct 2012

    Posted 05 Nov 2012 Link to this post

    I'm simply trying to fire an event, and it doesn't work. (I'm starting to feel like Kendo is a beta that we pay to test.)

    Markup:

    @(Html.Kendo().AutoCompleteFor(m => m.EditName)
    .Events(e => e.Select("alert('test')"))
    .DataSource(source =>
              source.Read(read => read.Action("GetUsers", "Administration"))
                  .ServerFiltering(true)))

    Here's what happens. It fires the alert box upon page load, and never again. Also, it doesn't matter what the event is. I can make the event "Select", "Change", "Open", "Close".... it always fires once upon page load, and never again.

    I tried using the Latest Internal build... did not fix it. I just want to fire an event upon Select, not upon page load. Please advise what I'm doing wrong. Thanks.
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 06 Nov 2012 Link to this post

    Hi David,

     This is not a supported way to handle a client-side event. You should specify the name of a JavaScript function which will handle the event not executable JavaScript code. Please refer to the documentation

    All the best,
    Atanas Korchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Dave
    Dave avatar
    35 posts
    Member since:
    Oct 2012

    Posted 06 Nov 2012 Link to this post

    Yes, obviously this was intended to be used with a function. It does not work with a function either. I just happened to paste the code block when I was trying inline javascript.

    It does not work with a javascript function. It's the same result. Please tell me how to make the events fire when they are supposed to fire. Thanks.
  5. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 06 Nov 2012 Link to this post

    Hi David,

     Did you check the sample ASP.NET MVC application which is shipped with the Kendo distribution? It contains a demo which shows how to use the client side events of the the autocomplete. More info can be found here.

    Regards,
    Atanas Korchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
UI for ASP.NET MVC is VS 2017 Ready