Posted 24 June 2022, 3:37 am EST
We have an Angular app that includes over 100 instances of the FlexGrid. As such, we’ve created a wrapper component to encapsulate common functionality.
We typically build the column config in code and set the columnLayout property on the grid. However, there are times when it’d be much simpler to create the columns using markup; especially when building cell templates.
The problem is that the WjFlexGrid does not allow columns to be assigned dynamically using content projection. It throws errors.
Here’s a working example:
https://jscodemine.grapecity.com/sample/4BE6uUYeL0uytHmnNdBQAw/
<app-custom-grid [data]="data">
<ng-container columns>
<wj-flex-grid-column binding="id" header="ID"></wj-flex-grid-column>
<wj-flex-grid-column binding="country" header="Country"></wj-flex-grid-column>
<wj-flex-grid-column binding="sales" header="Sales"></wj-flex-grid-column>
<wj-flex-grid-column binding="expenses" header="Expenses"></wj-flex-grid-column>
</ng-container>
</app-custom-grid>
It would be great if this could be fixed and dynamic content could be projected into the WjFlexGrid component. Or maybe I’m just unaware of some magic feature and you can fill me in
Thanks.