https://github.com/swimlane/ngx-datatable/blob/master/demo/sorting/sorting-client.component.ts
in ngx-datatable, the datatable can be sorted with a click on the header column, however, I want to do some inline edit on the row and return the values with something like
edit($event, rowIndex, cellName)
The rowIndex return the sorted index, which is not matched with the original input rows (array), how to get a sorted array from the datatable?
UPDATED
$$index not working on 10.1.0 ngx-datatable version
<ng-template let-row="row" let-value="value" ngx-datatable-cell-template>
{{rows.indexOf(row)}}.{{value}}
</ng-template>
is the only way i guess
Check for documentation:
Each row is decorated with a $$index attribute. This allows us to track the actual index of the row. This is needed because if you are lazy loading data into the grid the index upon which the data is loaded might not always be the 'actual' index its inserted.
This is also leveraged by the virtual scroll so it knows how to offset the row in the page's view port.
<ng-template ngx-datatable-cell-template let-row="row" let-value="value">
{{row.$$index}}.{{value}}
</ng-template>