Combobox Cascading need more specific cascadeFrom option

后端 未结 1 1389
耶瑟儿~
耶瑟儿~ 2021-01-03 01:17

I want to use the cascadeFrom feature of the Kendo UI ComboBox, but to my dismay it seems that that option will only accept an ID. Now I can\'t use the ID because the combob

相关标签:
1条回答
  • 2021-01-03 01:37

    That cascading functionality is just some sugar to make it easier create cascading DropDowns/Combos.

    Basically you need to use 4 things to manually implement yourself that fancy cascading-> change event of the parent ComboBox, enable method of the child ComboBox,value method of the parent ComboBox and the dataSource.read() method of the child ComboBox.

    Initially the child is enabled(false) when the change event of the parent is triggered get the value of the parent and pass it to the read method of the child dataSource.read() method to send it to the server. Finally return the needed records from the server.

    function OnChangeOfParentCombo(e){
         var child = $('#ChildCombo').data().kendoComboBox;
         child.enable(true);
         child.dataSource.read({myFilter:this.value()});
    }
    
    0 讨论(0)
提交回复
热议问题