<script type="text/javascript">
function click() {
var gridObj = $("#Grid").ejGrid('instance');
gridObj.model.columns[0]['headerText'] = "CustomerOrder"; //set the headerText value to the OrderID column
gridObj.refreshHeader();
gridObj.refreshContent();
}
</script> |
<ej-grid id="Grid" [dataSource]="gridData1" [allowPaging]="true" [editSettings]= "edit" [toolbarSettings]= "tool" (actionComplete)="onActionComplete($event)"> >
<e-columns>
----------------------
</e-columns>
</ej-grid>
|
[grid.component.html]
<ej-grid [allowPaging]="true" [dataSource]="gridData" >
<e-columns>
<div *ngFor="let item of items">
<e-column [field]="item.field" [headerText]="item.headerText"></e-column>
</div>
</e-columns>
</ej-grid>
----------------
[grid.component.ts]
export class GridComponent {
public items = [
{ "field": "OrderID", "headerText": "Order ID" },
{ "field": "CustomerID", "headerText": "Cutomer" },
{ "field": "EmployeeID", "headerText": "Employeemer" }
];
constructor() {
-----
}
}
|