ember-table
ember-table copied to clipboard
cellComponent not working with Octane components
cellComponent doesn't appear to be working with Ember Octane components:
routes/mytable.js
model = {
columns: [
{
name: "Foo",
valuePath: "foo"
}, {
name: "Test",
cellComponent: 'test'
}
],
rows: [
{
"foo": "This is a test",
}
]}
components/test.hbs
<p>Testing component</p>
templates/mytable.hbs
<EmberTable as |t|>
<t.head
@columns={{@model.columns}}
@enableResize={{true}}
@enableReorder={{false}}
@sorts={{@model.sorts}}
@onUpdateSorts={{action (mut @model.sorts)}} />
<t.body @rows={{model.rows}} />
</EmberTable>
This results in the table rendering as expected, with the first column displaying "This is a test" as expected, but nothing appearing in the second column with the cellComponent.
@jtwolgamott I dont believe there is support for cellComponent
built in. From the docs you can use your column definition to use the component helper in the template directly:
<EmberTable as |t|>
<t.head
@columns={{@model.columns}}
@enableResize={{true}}
@enableReorder={{false}}
@sorts={{@model.sorts}}
@onUpdateSorts={{action (mut @model.sorts)}} />
<t.body @rows={{model.rows}} as |b|>
<b.row as |r|>
<r.cell as |cell column row|>
{{component column.cellComponent row=row}}
</r.cell>
</b.row>
</t.body>
</EmberTable>