|
<div class="control-section">
<ejs-grid #grid [dataSource]='data' height='350' [columns] ='fieldName'>
</ejs-grid>
</div> |
<e-column field='file_name' headerText='File Name' clipMode='EllipsisWithTooltip' textAlign='Center' width=auto>|
export class DefaultComponent implements OnInit {
ngOnInit(): void {
this.data = stringData;
this.fieldName = Object.keys(stringData[0]);
}
test() {
let stringData1 = [
{
"OrderID":10248123,
"CustomerName":"VINETEEEEL",
}];
this.fields = ["OrderID", "CustomerName"];
let cols= [];
for (var field of this.fields) {
cols.push({'field': field, 'headerText': 'File Name', 'width':'auto', 'clipMode': 'EllipsisWithTooltip', 'textAlign':'Center'});
}
this.fieldName = cols;
this.data = stringData1;
}
|