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

Cascading ComboBox with local data

2 Answers 128 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
mgs
Top achievements
Rank 1
mgs asked on 21 Feb 2013, 10:31 AM
I tried to follow Cascading ComboBoxes, but I cannot make it work. The code is as follows...

<input id="cmb21a" />
<input id="cmb21b" />
 
<script>
    $("#cmb21a").kendoComboBox({
       dataTextField: "name",
       dataTextValue: "parentID",
       dataSource: {
          data: [
                  { parentID: 1, name: "P1" },
                  { parentID: 2, name: "P2" },
                  { parentID: 3, name: "P3" }
          ]
       }
    });
 
    $("#cmb21b").kendoComboBox({
       cascadeFrom: "cmb21a",
       dataTextField: "name",
       dataTextValue: "id",
       dataSource: {
          data: [
                  { parentID: 1, id: 11, name: "P1a"},
                  { parentID: 1, id: 12, name: "P1b" },
                  { parentID: 1, id: 13, name: "P1c" },
                  { parentID: 2, id: 21, name: "P2a" },
                  { parentID: 2, id: 22, name: "P2b" },
                  { parentID: 2, id: 23, name: "P2c" },
                  { parentID: 3, id: 31, name: "P3a" },
                  { parentID: 3, id: 32, name: "P3b" }
          ]
       }
    });
 </script>
Something seems to be missing. After loading the first combobox contains all data, the second combobox is disabled. When selecting a value from the first combobox, the second combobox shows a spinning icon, looping forever.

Michael G. Schneider

2 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 22 Feb 2013, 01:35 PM
Hello Michael,

 
The correct option, which defines which is the widget's value field is dataValueField. Please check this help topic for more information abour cascading functionality.

Greetings,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
mgs
Top achievements
Rank 1
answered on 25 Feb 2013, 06:23 PM
Hello Georgi,

thanks a lot for the answer. You are correct. It was my mistake to use "dataTextValue" instead of "dataValueField".

Michael G. Schneider
Tags
ComboBox
Asked by
mgs
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
mgs
Top achievements
Rank 1
Share this question
or