Hi,
I have a component with ejs-grid and I want to use this like a generic component to show tables. I define some columns throught an array, and I add one custom column to select rows with checkbox, and another custom row for show custom button actions.
It is possible to use ng-content in a column? I want to define the buttons actions in the component that uses the table component.
For example, this is the template of a component that uses the generic table component:
...
<table-component>
<ng-container slot="actions"> <button>Editar</button> </ng-container>
</table-component>
...
The table-component template:<ng-container *ngIf="data$ | async as tableData">
<ejs-grid #table [dataSource]="tableData.data" [columns]="tableData.columns">
<e-columns>
<e-column type='checkbox' width='50' [showInColumnChooser]='false'></e-column>
<e-column *ngFor="let column of tableData.columns"
[field]='column.field' [headerText]='column.headerText'
[customAttributes]="{'data-column-name': column.headerText}">
</e-column>
<e-column headerText='Acciones'>
<ng-template #template let-data>
<ng-content select="[slot='actions']"></ng-content>
</ng-template>
</e-column>
</e-columns>
</ejs-grid>
</ng-container>
This implementation show the table with data, the first column with checkbox to select each row, the columns defined in tableData.columns and the last column. But on the last column, the button that I set in the component only show on the last row of the table.
How can I get to show the buttons in all the rows?
Thanks for your help.