Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
144316 | Apr 30,2019 11:17 AM UTC | May 1,2019 07:38 PM UTC | Angular - EJ 2 | 1 |
![]() |
Tags: Grid |
<div class="control-section">
<ejs-grid #grid [dataSource]='data' id='Grid'>
<ng-template #detailTemplate let-data>
<table class="detailtable" width="100%">
...
<tbody>
<tr>
<td rowspan="4" style="text-align: center;">
<img class='photo' src="./assets/grid/images/{{data.EmployeeID}}.png" alt="{{data.EmployeeID}}" />
</td>
<td>
<span style="font-weight: 500;">First Name: </span> {{data.FirstName}}
</td>
<td>
<span style="font-weight: 500;">Postal Code: </span> {{data.PostalCode}}
</td>
</tr>
...
</tbody>
</table>
</ng-template>
<e-columns>
<e-column headerText='Expand/collapse' width='150' textAlign='Center'>
<ng-template #template let-data>
<button (click)="clicked($event)">Click</button>
</ng-template>
</e-column>
...
</e-columns>
</ejs-grid>
</div> |
...
export class AppComponent {
...
ngOnInit(): void {
...
}
clicked(e) {
let tr = parentsUntil(e.target, 'e-row');
let trIdx = parseInt(tr.getAttribute('aria-rowindex'));
if (parentsUntil(e.target, 'e-row').children[0].classList.contains('e-detailrowexpand')) {
this.grid.detailRowModule.collapse(trIdx)
} else {
this.grid.detailRowModule.expand(trIdx)
}
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.