Open catull opened 6 years ago
+1 - have experienced this bug too
+1
+1
Got the same issue.
I avoided this problem by running through my rows and setting an index property on them. Abominable, but it works.
+1
Can we get this merged please?
Workaround:
@ViewChild(DatatableComponent) // import {DatatableComponent} from '@swimlane/ngx-datatable';
private readonly table: DatatableComponent;
public getRowIndex(row: any): number {
return this.table.bodyComponent.getRowIndex(row); // row being data object passed into the template
}
<ng-template let-row="row" ngx-datatable-row-detail-template>
{{ getRowIndex(row) }}
</ng-template>
@smasala thank you for your comment, very helpful! it worked 100%!
I'm submitting a ... (check one with "x")
Current behaviour
Using ngx-datatable 11.3.2. I did read and learn from issue #992; the defect is still there.
This a sample snippet which manifests the problem:
All tabs have the same id in each row.
1st row: tab_0_1, tab_0_2, tab_0_3 2nd row: tab_0_1, tab_0_2, tab_0_3 <== should be tab_1_1, tab_1_2, tab_1_3
Expected behaviour
Would like rowIndex to be working.
Reproduction of the problem
Use the above snippet.
Please tell us about your environment:
Table version: 11.3.2
Angular version: 5.2.10
Browser: Chrome 66
Language: TypeScript 2.8.3