Hi Saravanan,
I have rendered the grid with columns defined by an array of objects using ng-template and ng-for:
<e-columns>
<ng-template ngFor let-column [ngForOf]="columns">
<e-column [field]="column.columnField" [headerText]="column.columnHeaderText"
[allowEditing]="column.allowEditing"
[editSettings]="column.editSettings"
[editType]="column.editType"
[isPrimaryKey]="column.isPrimaryKey"
[headerTemplateID]="column.headerTemplateID">
</e-column>
</ng-template>
</e-columns>
This will be the template then - the deliveryHeaderTemplate is further the selector for an angular-component - and this template will be used for a couple of columns:
<div id="deliveryHeaderTemplate" style="visibility:hidden">
<deliveryHeaderTemplate [someStuff]="this._deliveries"></deliveryHeaderTemplate>
</div>
Then I would like the component being rendered in <deliveryHeaderTemplate /> to know in which column of the grid it is in (i.e. have access to the actual value of column.columnField)
The template will then be manipulated by the logic of the deliveryHeaderTemplate-component.
Thank you for your support and let me know if need any further information.
Regards,
Thomas
<ej-grid [allowPaging]="true" [editSettings]="editsettings" [pageSettings.pageSize]="pagesize" [dataSource]="gridData">
<e-columns>
<ng-template ngFor let-column [ngForOf]="columns">
<e-column [field]="column.field"
[headerText]="column.headerText"
[allowEditing]="column.allowEditing"
[isPrimaryKey]="column.isPrimaryKey != null ? column.isPrimaryKey : null"
[width] = "column.width"
[headerTemplateID]="column.headerTemplateID != null ? column.headerTemplateID : null">
</e-column>
</ng-template>
</e-columns>
</ej-grid>
<div id="test">
<my-comp [mytext]="TestTemplate"></my-comp>
</div>
|
Thanks, that worked for me!