|
Grid.component.html:
<div id="Appconfigdata" style="background-color: #F5F5F5">
<ej-grid id=grid [allowPaging]="true" [dataSource]="gridData" (dataBound)="dataBound($event)">
<e-columns>
<e-column field="OrderID" headerText="Order ID" [isPrimaryKey]="true" width="75" textAlign="right"></e-column>
<e-column field="CustomerID" headerText="Customer ID" width="80"></e-column>
<e-column field="OrderDate" headerText="OrderDate" width="80"></e-column>
<e-column field="EmployeeID" headerText="Employee ID" width="75" textAlign="left"></e-column>
<e-column headerText="Arc Type" width="150">
<ng-template e-template let-data>
<input ej-dropdownlist [dataSource]="childData" fields="text" />
</ng-template>
</e-column>
</e-columns>
</ej-grid>
</div>
Grid.component.ts:
export class GridComponent {
public gridData: any;
constructor() {
...
dataBound(e){
setTimeout(()=>{
$(".e-templatecell .e-dropdownlist").ejDropDownList({change: function(args){
var gridObj = $("#grid").data("ejGrid");
var inx = this.element.closest("tr").index();
gridObj.setCellText(inx,2,new Date())
})
}
} |