5


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!

luc
  • 103
  • 2
  • 8

2 Answers2

13

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

https://www.primefaces.org/primeng/#/table

Srinivasan Sekar
  • 2,049
  • 13
  • 22
2

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}
}

View in StackBlitz

Kugan Kumar
  • 423
  • 1
  • 8
  • 14