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

Getting reference to kendoAutoComplete in change event

3 Answers 120 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Brian Vallelunga
Top achievements
Rank 1
Brian Vallelunga asked on 02 Feb 2012, 05:37 PM
I'm trying to use the AutoComplete control in an unbounded list of table rows. When the user clicks an add button, a new row is added and a new AutoComplete is created within that row.

This works well enough, but I'm trying to figure out how to get a reference to the AutoComplete instance from within a change event handler. Actually, I'd like to get at both the AutoComplete object and the initial input control it is based off of.

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 03 Feb 2012, 09:26 AM
Hi,

 Which change handler are you referring to? The one of the autocomplete or something else?

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!
0
Brian Vallelunga
Top achievements
Rank 1
answered on 03 Feb 2012, 02:30 PM
Yes, the AutoComplete change event handler. After trying a few more things, I realized that "this" actually references the AutoComplete control. Is there an easy way to get from the AutoComplete control to the underlying input box though?
0
Atanas Korchev
Telerik team
answered on 06 Feb 2012, 09:40 AM
Hello,

 The "element" field is a jQuery object pointing to the original input:

var input = this.element;

To get the underlying DOM element you could use this code:

var input = this.element[0];

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!
Tags
AutoComplete
Asked by
Brian Vallelunga
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Brian Vallelunga
Top achievements
Rank 1
Share this question
or