getting the selected item

2 posts, 0 answers
  1. Paolo
    Paolo avatar
    426 posts
    Member since:
    Jun 2009

    Posted 29 Jul 2013 Link to this post

    I've started playing with kendo and I got a problem with getting the data on the eventchanged... my code is

    <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
        <input id="comboBox" />
            $(document).ready(function () {
                    dataTextField: "text",
                    dataValueField: "value",
                    dataSource: [
                        { text: "Item1", value: "1" },
                        { text: "Item2", value: "2" }
                    change: function (e) {
                        var combobox = $("#comboBox").data("kendoComboBox");
                          var selectedIndex =;


    How do I get the object I've selected? for now it's as imple text/value what if it's an object of type

    text, value, additionalinfo?

  2. Dimiter Madjarov
    Dimiter Madjarov avatar
    2213 posts

    Posted 30 Jul 2013 Link to this post

    Hi Paolo,

    You could use the dataItem method of the ComboBox to get the model for the selected item. As a side note, the context of the event handler is the ComboBox and it is accessible via this.
    function change(e) {
        var text = this.text();
        var value = this.value();
        var object = this.dataItem(;

    I hope that this information was helpful for you. I wish you a great day!


    Dimiter Madjarov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top