shlomiassaf / ngrid

A angular grid for the enterprise
https://shlomiassaf.github.io/ngrid
MIT License
241 stars 41 forks source link

Dynamic template based on column configuration #284

Open Duskfall opened 1 year ago

Duskfall commented 1 year ago

I would like to ask you whether it's possible to use the data property of the PblColumn to store a consumer component reference in it, and then use that in the template to dynamically create a new instance based on that type. Even though I have declared it in the app-module or using PblNgridModule.withCommon([ { component: MyComponentContainer} ]), it doesn't seem to pick it up

<pbl-ngrid>
<div *pblNgridCellDef="'*'; value as value; col as col;">
    <component-container-that-dynamically-creates-components-based-on-col-type [item]="value" [column]="col">
    </component-container-that-dynamically-creates-components-based-on-col-type>
  </div>
</pbl-ngrid>