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

Grids and Nested DataSource Dependent DropDowns

1 Answer 111 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Louis
Top achievements
Rank 1
Louis asked on 28 Aug 2014, 02:14 AM
I need to have a dropdown list appear in each row of a grid that is "fed" from the DataSource of the parent grid.  I have a property in the grid datasource that is an object array.

Below is the grid datasource.  I have a KendoGrid with a template on the "programVersion" column that creates the drop down.  I'm failing adding the data to it.  I've created (stolen and modified) an example (http://jsbin.com/cacabi/1/) that does almost what I want (I've been googling for a couple of hours).  I've included my JSON Array in the datasource to show what I'm using. 
http://jsbin.com/cacabi/1/edit

I basically want the Category dropdown to be populated with the programVersion data (which is different for each row).

Any direction or guidance will be greatly appreciated.  Thanks in advance

{
    "entityKey": "268900",
    "number": "QR000024",
    "companyDescription": "Mountain West",
    "programDescription": "Intangible",
    "programVersions": [
        {
            "versionId": 201226,
            "versionDescription": "2013WorkingCapitalBudget",
            "isCurrent": 0
        },
        {
            "versionId": 201227,
            "versionDescription": "Anotherbudgetversion",
            "isCurrent": 0
        },
        {
            "versionId": 201208,
            "versionDescription": "WorkingBudget",
            "isCurrent": 1
        }
    ],
    "$c": 1981,
    "$r": 1,
    "$checked": false,
    "$checkedEnabled": true
}

1 Answer, 1 is accepted

Sort by
0
Louis
Top achievements
Rank 1
answered on 28 Aug 2014, 02:17 PM
I solved it at http://jsbin.com/cacabi/3/edit.

Basically I had to have a JSON Object field AND a field holding the selected value and had to drill down into the options of the editor function to get the data I needed.

The code has two drop downs, one is the standard common one from a separate data source and the other has the embedded data source.
Tags
Grid
Asked by
Louis
Top achievements
Rank 1
Answers by
Louis
Top achievements
Rank 1
Share this question
or