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 combobox is added dynamically and possibly multiple times resulting in multiple controls with the same ID.
Does anyone have any ideas on how I can either pass a specific dom object to the cascade or how I could possibly setup a custom cascade feature using the 'change' event?
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()});
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With