App.component.html
<ejs-grid [dataSource]='data' [editSettings]='editSettings' [toolbar]='toolbar' height='273px'>
<e-columns>
<e-column field='Freight' headerText='Freight' textAlign= 'Right'
editType= 'numericedit' [edit]='numericParams' width=120 format= 'C2'></e-column>
</e-columns>
</ejs-grid>
App.component.ts
export class AppComponent {
@ViewChild('grid', {static: false})
grid: GridComponent;
public editSettings: EditSettingsModel;
public data: Object[];
public toolbar: ToolbarItems[];
public numericParams: IEditCell;
public ngOnInit(): void {
this.data = hierarchyOrderdata;
this.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true };
this.toolbar = ['Add', 'Edit', 'Delete', 'Update', 'Cancel'];
this.numericParams = { params: { showSpinButton :false,decimals: 2, value: 5 } };
}
}
|