Kendo AutoComplete Get Index

3 posts, 0 answers
  1. Andrew
    Andrew avatar
    5 posts
    Member since:
    Nov 2011

    Posted 10 Mar 2016 Link to this post


    i'm looking for a way to get kendo autocomplete selected index or selected object i have tried this fiddler working fine but  i need to access those properties with button click 

    how can i do it

    $('button').on('click', function(e){
       var value = $('#autocomplete).data('kendoAutoComplete').value();

    only i can get this far. is there any other way to get whole object or selected index?


  2. Dimiter Topalov
    Dimiter Topalov avatar
    633 posts

    Posted 12 Mar 2016 Link to this post

    Hello Whey,

    You can get the currently selected data item and store it in a global variable in the Kendo UI AutoComplete's select event handler. Then the variable can be used in the button click handler:

    var currentlySelectedItem;
      dataTextField: "Txt",
      dataSource: {
            data: [
                { Txt : "GB1", value: 1 },
                { Txt : "GB2", value: 2 },
                { Txt : "GB3", value: 3 },
                { Txt : "GB4", value: 4 }
      select: function(e) {
        currentlySelectedItem = this.dataItem(e.item.index());;

    The selected item cannot be accessed through the value of the input element, because it is a regular DOM element and its value is a string.

    Let me know if you need further assistance.

    Dimiter Topalov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Andrew
    Andrew avatar
    5 posts
    Member since:
    Nov 2011

    Posted 16 Mar 2016 in reply to Dimiter Topalov Link to this post

    Thanks. that worked!!
Back to Top