Cascading ComboBox

6 posts, 1 answers
  1. Yuan
    Yuan avatar
    9 posts
    Member since:
    Jul 2014

    Posted 13 Jan 2015 Link to this post

    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!



  2. Answer
    Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 15 Jan 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Yuan
    Yuan avatar
    9 posts
    Member since:
    Jul 2014

    Posted 15 Jan 2015 in reply to Alexander Valchev Link to this post

    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.
  5. Yuan
    Yuan avatar
    9 posts
    Member since:
    Jul 2014

    Posted 15 Jan 2015 in reply to Alexander Valchev Link to this post

    Thank you for the answer, I will try that out.
  6. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 19 Jan 2015 Link to this post

    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!
     
  7. Yuan
    Yuan avatar
    9 posts
    Member since:
    Jul 2014

    Posted 20 Jan 2015 in reply to Alexander Valchev Link to this post

    Yes, your first answer actually solved my problem. Thank you very much!
Back to Top
Kendo UI is VS 2017 Ready