ember-table
ember-table copied to clipboard
Expand row to display custom component
I'm not sure this is possible with your current api.
Imagine expanding a row to display a graph of the row values instead of the rowValue.children. For example:
<t.body @rows={{rows}} as |b|>
<b.row as |r|>
<r.cell>
{{#if r.hasGraph}}
<#r.expanded>
<my-graph data=r.rowValue/>
</r.expanded>
{{/if}}
</b.row>
</t.body>
So I don’t think we could implement this yet. I think the key issue is you probably want this graph to display across multiple cells (probably the entire table) while the parent still consists of multiple cells. I think ELT supports this.
I think it would make sense to add an escape hatch that would make this possible. How about if in addition to children, every row object can have cells, which is used as the values for the cells IFF it exists.
Each cell should be able to also directly specify thinks like columnSpan and rowSpan. This would allow users to use those features of a table naturally. If columnSpan is not defined, we can automatically fill it in somehow.
So, with this api in place, you’d be able to do something like the following:
rows = [{
children: [{
cells: [{
isGraph: true
}],
}]
}]
This would require a bit of massaging to get the data in the right format, but is also very general and I think a great escape hatch to have!
hi,
we use currently ELT, but since we need to support fixed header and (1st) column (and because I also prefer the ET syntax) we would love to switch to ember-table, but we have a few tables with expandable rows that have custom components that are using the full width of the row, just as Bryan described.
I guess chances are slim, but any chance this feature will make it to ember-table (in the not so distant future)? Or is there any hack possible until it's properly supported?
thx, robert
Hey @roberkules, unfortunately I don't have any time to push this forward and don't know when I will 😕 I definitely think this is something that would be worthwhile to support, and I don't think it would be that difficult to add, I just don't have the time