Hello,
I have a dropdownlist that I just cannot select anything out of. Here's my code:
If you look at the changeParentalControl there's a debugger inside that doesn't get hit.
HTML:
<kendo-dropdownlist
[data]="getParentalControlLevels()"
[textField]="'description'"
[valueField]="'name'"
[value]="getParentalControlLevelDisplay(itemPropertyEdit[1])"
(valueChange)="changeParentalControl($event)"
/>
TS:
interface ParentalControlLevelDisplay {
id: number;
description: string;
name: string;
}
getParentalControlLevels(): ParentalControlLevelDisplay[] {
if (this.assignments.length <= 1) return [];
return [
{id: 0, name: '', description: 'Adults, Teens, Kids'},
{id: 1, name: 'teens', description: 'Adults, Teens'},
{id: 2, name: 'adults', description: 'Adults'},
];
}
getParentalControlLevelDisplay(name: any): ParentalControlLevelDisplay | undefined {
let itemParentalControlTypes: ParentalControlLevelDisplay[] = [
{id: 0, name: '', description: 'Adults, Teens, Kids'},
{id: 1, name: 'teens', description: 'Adults, Teens'},
{id: 2, name: 'adults', description: 'Adults'},
];
let found = itemParentalControlTypes.find((t) => t.name == name);
return (found === undefined) ? undefined : found;
}
itemPropertyEdit: [string, string] = ['itemParentalControlLevel', 'adults'];
public changeParentalControl(event: any) {
debugger; // <--- this doesn't get hit!
this.itemPropertyEdit = event;
}