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

Cascading ComboBox child list not rendering

1 Answer 81 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
IT
Top achievements
Rank 1
IT asked on 14 Jan 2014, 08:36 PM
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.

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 16 Jan 2014, 10:17 AM
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!
Tags
ComboBox
Asked by
IT
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or