|
| 1 | +import { Component } from '@angular/core'; |
| 2 | +import { RouterOutlet } from '@angular/router'; |
| 3 | +import { ListBoxModule } from '@syncfusion/ej2-angular-dropdowns'; |
| 4 | + |
| 5 | +@Component({ |
| 6 | + selector: 'app-root', |
| 7 | + standalone: true, |
| 8 | + imports: [RouterOutlet, ListBoxModule], |
| 9 | + templateUrl: './app.component.html', |
| 10 | + styleUrl: './app.component.css' |
| 11 | +}) |
| 12 | +export class AppComponent { |
| 13 | + public data: { [key: string]: Object }[] = [ |
| 14 | + { item: 'Cabbage', id: 'item1', category: 'Leafy Vegetables' }, |
| 15 | + { item: 'Pumpkins', id: 'item2', category: 'Leafy Vegetables' }, |
| 16 | + { item: 'Spinach', id: 'item3', category: 'Leafy Vegetables' }, |
| 17 | + { item: 'Green bean', id: 'item4', category: 'Beans' }, |
| 18 | + { item: 'Horse gram', id: 'item5', category: 'Beans' }, |
| 19 | + { item: 'Chickpea', id: 'item6', category: 'Beans' } |
| 20 | + ]; |
| 21 | + |
| 22 | + public fieldSettings = { |
| 23 | + text: 'item', value: 'id', groupBy: 'category' |
| 24 | + }; |
| 25 | + |
| 26 | + public dataChild = [ |
| 27 | + { item: 'Watercress', id: 'item1', category: 'Leafy Vegetables' }, |
| 28 | + { item: 'Beet Greens', id: 'item2', category: 'Leafy Vegetables' }, |
| 29 | + { item: 'Romaine Lettuce', id: 'item3', category: 'Leafy Vegetables' }, |
| 30 | + { item: 'Black Beans', id: 'item4', category: 'Beans' }, |
| 31 | + { item: 'Soybeans', id: 'item5', category: 'Beans' }, |
| 32 | + { item: 'Lentils', id: 'item6', category: 'Beans' } |
| 33 | + ]; |
| 34 | + |
| 35 | + public fieldSettingsChild = { |
| 36 | + text: 'item', value: 'id', groupBy: 'category' |
| 37 | + } |
| 38 | + |
| 39 | +} |
0 commit comments