Cascading ComboBox child list not rendering

2 posts, 0 answers
  1. IT
    IT avatar
    1 posts
    Member since:
    Dec 2013

    Posted 14 Jan 2014 Link to this post

    I am having trouble rendering my child Combox using the cascade option.

    Here are the parent/child data sources which shows I'm attempting to link the child "parent_id" to the parent "portfolioIid"

    portfoliosList
    {"portfoliosList": "Member1", "portfolio_id": 2 } ,
    {"portfolioName": "Member2", "portfolio_id": 3}

    accountsList array:
          
                { "account_id": 4, "accountName": "Account1", "parent_id": 2 },
                { "account_id": 5, "accountName": "Account2", "parent_id": 2 },
                { "account_id": 6, "accountName": "Account3", "parent_id": 3 },
                { "account_id": 7, "accountName": "Account4", "parent_id": 3 }

    Here are my editor function which are attached to my grid:

    /// POPULATE PORTFOLIOS (aka Members) COMBOBOX
        function portfolioComboBoxEditor(container, options) {
            var input = $('<input required id="portfolioName" name="portfolioName" data-text-field="portfolioName" data-value-field="portfolio_id" data-bind="value:' + options.field + '"/>');

            input.appendTo(container);
            input.kendoComboBox({
                dataTextField: "portfolioName",
                dataValueField: "portfolio_id",
                dataSource: {
                    type: "json",
                    data: portfoliosList
                },
                optionLabel: "Choose a portfolio",
            }).appendTo(container);
        }
        /// POPULATE ACCOUNTS COMBOBOX
        function accountComboBoxEditor(container, options) {
            var input = $('<input required id="accountName" name="accountName" data-text-field="accountName" data-value-field="account_id" data-bind="value:' + options.field + '"/>');

            input.appendTo(container);       
            input.kendoComboBox({
                cascadeFrom: "portfolioName",
                cascadeFromField: "parent_id",
                dataTextField: "accountName",
                dataValueField: "account_id" ,
                dataSource: {
                    type: "json",
                    data: accountsList
                },
                autoBind: false,
                filter: "contains",
                optionLabel: "Choose an account",
            }).appendTo(container);
           
        }


     I'm not sure where I'm going wrong. The the child combobox (is initially is grayed out) but then remains an empty list.

    Thank you in advance for your assitance.
  2. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 16 Jan 2014 Link to this post

    Hi,

    I already posted response in the support ticket that you opened on the same subject.

    For reference I will paste my response below:

    ---------------------------------------------------------------------------------------------------------------

    I see no problem with your code, I even created JsBin from it:

    http://jsbin.com/IgeFUjaf/2/edit

    Demonstrate your case with a JsBin so I can investigate further.


    Kind Regards,
    Petur Subev
    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
Back to Top