Skip to content

Kendo UI Combo Binding #561

@DhimantB

Description

@DhimantB

**@component({
selector: 'my-app',
template: <div class="example-config"> Selected Item: {{selectedItem | json}} </div> <kendo-combobox [data]="listItems" [textField]="'catdes.CategoryName'" [valueField]="'catdes.CategoryName'" [(ngModel)]="selectedItem" [valuePrimitive]="true" > </kendo-combobox>
})
export class AppComponent {
public listItems: Array = categories;

public selectedItem: categories = this.listItems[1];
}

export const categories = [
{
"CategoryID": 1,
catdes:
{
"CategoryName": "Beverages",
"Description": "Soft drinks, coffees, teas, beers, and ales"
}
},
{
"CategoryID": 2,
catdes:
{"CategoryName": "Condiments",
"Description": "Sweet and savory sauces, relishes, spreads, and seasonings"}
},
{
"CategoryID": 6,
catdes:
{"CategoryName": "Meat/Poultry",
"Description": "Prepared meats"}
},
{
"CategoryID": 7,
catdes:
{"CategoryName": "Produce",
"Description": "Dried fruit and bean curd"}
},
{
"CategoryID": 8,
catdes:
{"CategoryName": "Seafood",
"Description": "Seaweed and fish"}
}
];

export const catdes
{
CategoryName: String;
Description: String;
}**

With the above code, I am not able to see any values in my combo box. May I know what I am doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions