Cascading ComboBox with local data

3 posts, 0 answers
  1. mgs
    mgs avatar
    163 posts
    Member since:
    Jan 2011

    Posted 21 Feb 2013 Link to this post

    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. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 22 Feb 2013 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. mgs
    mgs avatar
    163 posts
    Member since:
    Jan 2011

    Posted 25 Feb 2013 Link to this post

    Hello Georgi,

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

    Michael G. Schneider
Back to Top