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

Events not firing properly

3 Answers 108 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 05 Nov 2012, 06:42 PM

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.

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 06 Nov 2012, 07:22 AM
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!
0
Dave
Top achievements
Rank 1
answered on 06 Nov 2012, 02:15 PM
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.
0
Atanas Korchev
Telerik team
answered on 06 Nov 2012, 02:19 PM
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!
Tags
AutoComplete
Asked by
Dave
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Dave
Top achievements
Rank 1
Share this question
or