I'm submitting a ... (check one with "x")
[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here
Current behavior
In the documentation, the rowHeight input is specified to be of type number indicating the height of the detail component DatatableRowDetailDirective
Expected behavior
Expected the type to be number 聽| 'auto' with information on the auto height option.
Reproduction of the problem
Set rowHeight to auto and it adjusts to the content height.
<ngx-datatable [rowHeight]="'auto'">
<ngx-datatable-row-detail [rowHeight]="'auto'">
<template let-row="row" ngx-datatable-row-detail-template>
{{row.detail}}
</template>
</ngx-datatable-row-detail>
<ngx-datatable-column name="ColumnName">
<template let-row="row" ngx-datatable-cell-template>
{{row.title}}
</template>
</ngx-datatable-column>
</ngx-datatable>
What is the motivation / use case for changing the behaviour?
Makes the possibility clear and the library more accessible.
Please tell us about your environment:
Auto row height is not possible due to the ahead of time calculations for virtualization of dom. Sorry :(
@amcdnl What is the purpose of this then???? 馃槙
Very sad..
Does anyone have a "manual" calculate (even with the DOM itself) for dynamic row details height that we can use for the method on "rowHeight" property?
@eladcandroid were you able to find a solution? I'm trying to solve this exact problem.
Put this into your scss
:host {
/deep/ .datatable-row-detail {
height: 100% !important;
background-color: red !important;
}
}
I am not sure if this is still an issue, but we solved it this way:
<ngx-datatable-row-detail [rowHeight]="'100%'">
A little similar to the scss workaround @h6784rfg6 mentioned, but we were trying to avoid /deep/ because it is deprecated and going to be removed.
Thanks @h6784rfg6 and @Schmaga
Another solution that worked for me was to emit an event to the parent component which recalculates the rowHeight property, however the user notices a slight delay when the event is emitted, so I will look into implementing one of the above solutions.
h6784rfg6's and Schmaga's answers are both partially right. there is more you need to do to make responsive height work:
On the button that expands the
Mine looks like this:
<ng-template let-row="row" ngx-datatable-cell-template>
<a href="javascript:void(0);"
class="color-black fa"
[ngClass]="{'fa-minus-square-o':row.$$expanded,
'fa-plus-square-o':!row.$$expanded}"
title="View Details"
(click)="toggleExpandRow(row,$event)">
</a>
</ng-template>
If you got lost just notice the (click)="toggleExpandRow(row,$event)"
Then in your component.ts add the following:
toggleExpandRow(row,$event) {
if(row.$$expanded){
this.expandRow($event);
}else{
this.collapseRow($event);
}
this.table.rowDetail.toggleExpandRow(row);
}
And this:
expandRow($event){
$event.toElement.closest('datatable-row-wrapper').className = "";
}
collapseRow($event){
$event.toElement.closest('datatable-row-wrapper').className ="expanded";
}
Now
Thanks @h6784rfg6 and @Schmaga
I removed [scrollbarV]="true", the width of this row is inherited from 'datatable-scroller' element, and if overwrite the width of this element, it destroys all the screen.

I'm submitting a ... (check one with "x")
[ ] bug report => search github for a similar issue or PR before submitting [x] feature request [ ] support request => Please do not submit support request hereCurrent behavior
In the documentation, therowHeightinput is specified to be of typenumberindicating the height of the detail componentDatatableRowDetailDirectiveExpected behavior
Expected the type to benumber 聽| 'auto'with information on the auto height option.Reproduction of the problem
SetrowHeighttoautoand it adjusts to the content height.<ngx-datatable [rowHeight]="'auto'"> <ngx-datatable-row-detail [rowHeight]="'auto'"> <template let-row="row" ngx-datatable-row-detail-template> {{row.detail}} </template> </ngx-datatable-row-detail> <ngx-datatable-column name="ColumnName"> <template let-row="row" ngx-datatable-cell-template> {{row.title}} </template> </ngx-datatable-column> </ngx-datatable>What is the motivation / use case for changing the behaviour?
Makes the possibility clear and the library more accessible.Please tell us about your environment:
- OS: Mac OS X 10.12
- Editor: VS Code 1.9.1
- Package manager: npm
- Table version: 6.1.2
- Angular version: 2.4.7
- Browser: Chrome 56
- Language: TypeScript 2.1.6
This was helpful, thankyou.
Most helpful comment
I am not sure if this is still an issue, but we solved it this way:
<ngx-datatable-row-detail [rowHeight]="'100%'">A little similar to the scss workaround @h6784rfg6 mentioned, but we were trying to avoid /deep/ because it is deprecated and going to be removed.