@Component({
selector: 'app-root',
template: `<ejs-grid [dataSource]='data' [editSettings]='editSettings' [toolbar]='toolbar' height='273px'>
<e-columns>
<e-column field='ShipCountry' headerText='Ship Country' editType='dropdownedit' [edit]='ddParams' width=150></e-column>
</e-columns>
</ejs-grid>`
})
export class AppComponent implements OnInit {
public data: Object[];
public editSettings: EditSettingsModel;
public toolbar: ToolbarItems[];
public ddParams: IEditCell;
ngOnInit(): void {
this.data = data;
this.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true };
this.toolbar = ['Add', 'Edit', 'Delete', 'Update', 'Cancel'];
this.ddParams = { params: {dataSource: ['test 1', 'test 2'],query: new Query(),placeholder: 'arjuna' } };
}
}
}
|