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

Cascading ComboBox

5 Answers 121 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Yuan
Top achievements
Rank 1
Yuan asked on 13 Jan 2015, 09:01 PM
I'm trying to use cascade ComboBoxes.
In the parent ComboBox, I registered a change event like
change: function(e) {
    e.preventDefault();
    var child = $('#child').data('kendoComboBox');
    var childDataSourceUrl = "/data/source?param=" + this.value();
    child.dataSource = new kendo.data.DataSource({
        type: "json",
        serverFiltering: false,
        transport: { read: { url : childDataSourceUrl } }
    });
    child.dataSource.read();
}
When child.dataSource.read(); is called, it fires a ajax call correctly, and the response is also correct. But the data doesn't bind with child ComboBox, leaving it blank. Any idea why? And how to solve it?
Thanks!



5 Answers, 1 is accepted

Sort by
0
Accepted
Alexander Valchev
Telerik team
answered on 15 Jan 2015, 12:16 PM
Hi Yuan,

To change the dataSource of a given widget you should use its setDataSource method.
On a side note, may I know why you are not using the build-in cascading functionality demonstrates in this demo page:
Corresponding documentation can be found at: http://docs.telerik.com/kendo-ui/web/combobox/cascading

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Yuan
Top achievements
Rank 1
answered on 15 Jan 2015, 03:24 PM
The reason I didn't want to use in-built cascading is I want to fire ajax call to get child combobox data without using server filtering.
0
Yuan
Top achievements
Rank 1
answered on 15 Jan 2015, 03:24 PM
Thank you for the answer, I will try that out.
0
Alexander Valchev
Telerik team
answered on 19 Jan 2015, 08:30 AM
Hello Yuan,

Your last messages are confusing. Did you manage to find to a solution that suits in your case?

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Yuan
Top achievements
Rank 1
answered on 20 Jan 2015, 07:12 PM
Yes, your first answer actually solved my problem. Thank you very much!
Tags
ComboBox
Asked by
Yuan
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Yuan
Top achievements
Rank 1
Share this question
or