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!
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
0
Accepted
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
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
Hello Yuan,
Your last messages are confusing. Did you manage to find to a solution that suits in your case?
Regards,
Alexander Valchev
Telerik
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!