I want to trigger a reorder event after I drag and drop two rows data but I cannot see it in the document below:
https://www.primefaces.org/primeng/#/table/reorder
Can anyone help me, thanks!
How to catch row reorder event in primeng table?
Asked Answered
As per the documentation ,
there are two callbacks available ,
onColReorder - Callback to invoke when a column is reordered
onRowReorder - Callback to invoke when a row is reordered.
They are listed under on the events portion on the same page
For those wondering where to bind the onRowReorder
callback to catch row reorder event.
app.component.html:
<p-table [value]="products" (onRowReorder)="onRowReorder($event)">
...
</p-table>
app.component.ts:
onRowReorder(event){
console.log(event); //{dragIndex: 1, dropIndex: 2}
}
© 2022 - 2024 — McMap. All rights reserved.