ssuperczynski / ngx-easy-table

The Easiest Angular Table. 12kb gzipped! Tree-shakeable. 55 features and growing!
https://ngx-easy-table.eu
MIT License
371 stars 100 forks source link

Access cell value in cellTemplate #417

Open nigelsim opened 1 year ago

nigelsim commented 1 year ago

Is your feature request related to a problem? Please describe. I want to be able to easily access the cell value from the cellTemplate, rather than having to read it from the row variable. In my case, the column key is a nested object. I don't have access to the render pipe, so I can't easily extract it either.

Describe the solution you'd like Just expose the value as extracted by the render pipe as a template variable. This is all I'd need 90% of the time, and will make the templates more reusable. e.g., in my case, I want a light (on/off) based on the boolean value of the column. The column may be enabled or chilld.enabled.

Describe alternatives you've considered Currently I've just copied the render pipe to my own code base.

ssuperczynski commented 3 months ago

Hello @nigelsim, currently, there are two options:

this.columns = [
      { key: 'address.number', title: 'Number' },
      { key: 'address.street', title: 'Street' },
    ];

Does this work for you, or do you need a different solution?