[app.component.ts]
export class AppComponent {
@ViewChild('local')
public comboObj: ComboBoxComponent;
public sportsData: Object[] = [
{ Id: 'Game1', Game: 'American Football' },
{ Id: 'Game2', Game: 'Badminton' },
{ Id: 'Game3', Game: 'Basketball' },
{ Id: 'Game4', Game: 'Cricket' },
{ Id: 'Game5', Game: 'Football' },
{ Id: 'Game6', Game: 'Golf' },
{ Id: 'Game7', Game: 'Hockey' },
{ Id: 'Game8', Game: 'Rugby' },
{ Id: 'Game9', Game: 'Snooker' },
{ Id: 'Game10', Game: 'Tennis' }
];
// maps the local data column to fields property
public localFields: Object = { text: 'Game', value: 'Id' };
// set the placeholder to ComboBox input element
public localWaterMark = "Select game";
public onCreate(args){
this.comboObj.focusIn();
} |