Currently, I am attempting to retrieve the most recent 'clicked' row from ngx-datatable. Here is what I have in my code:
<ngx-datatable
[rows]="rows"
[selected]="selected"
[selectionType]="'multiClick'"
(select)='onSelect($event)'
(dblclick)='onDoubleClick($event)'
>
Since the selected rows are stored in 'rows', one approach that almost works is to obtain the latest selected row in this manner:
const latest = selected[selected.length - 1];
However, the issue arises when the latest clicked row is deselected (having been selected at a prior point), causing it to be removed from the 'selected' array and rendering the above approach ineffective. Is there an alternative method to resolve this issue and accurately retrieve the latest 'clicked' row?