ComboBox Change Event Can't Access Other Values of DataSource

2 posts, 0 answers
  1. StevenDom
    StevenDom avatar
    14 posts
    Member since:
    Aug 2014

    Posted 03 Oct 2014 Link to this post

    I have configured a Kendo ComboBox as follows:

        var junk = $("#junk").kendoComboBox({
            dataTextField: "Code",
            dataValueField: "Id",
            dataSource: {
                type: "json",
                //serverFiltering: true,
                transport: {
                    read: {
                        url: "myServlet?action=ReadJunk",
                        contentType: "application/json;charset=utf-8",
                        dataType: "json"
                schema: {
                    model: {
                        id: "Id",
                        fields: {
                            Id: {
                                type: "integer"
                            Code: {
                                type: "string"
                            shortDescription: {
                                type: "string"
            change: function(e){
                // in here I want to set the ShortDesc widget's content to the selected shortDescription
                $("#ShortDesc").value = "shortDescription";  // this doesn't work

    The values ID, Code, and shortDescription are properly being returned by my Java Servlet. In the change event I would like set the value of another control to the value of shortDescription that is associated with the selected ComboBox item. What is the proper format for accessing this value?


  2. Georgi Krustev
    Georgi Krustev avatar
    3725 posts

    Posted 07 Oct 2014 Link to this post

    Hello Steven,

    If I understand you correctly, you would like to get the selected data item. If my assumption is correct, you can use the widget dataItem method:
    change: function(e){
         var dataItem = e.sender.dataItem();
         if (dataItem) {
                $("#ShortDesc").value = dataItem.shortDescription;

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