0

I am using Primefaces 8.0 and have a datatable which allows reordering. I want to reorder all the row, but last 3 rows. How to do that? Please help me, I couldnt find anything that solves my requirement.

<p:ajax event="rowReorder" listener="#{bean.onRowReorder}" update=":form"/>

Melloware
  • 10,435
  • 2
  • 32
  • 62
AAPJ
  • 37
  • 1
  • 10

1 Answers1

0

Idea1)

Is this of any help? My guess is it's not, but i didn't test it.

Disable row selection for a few rows only in a p:dataTable

Idea2)

Could you make that rows be first 3 and say frozenRows=3? Maybe give them different CSS?

Idea3)

Write javascript function and call it onstart in p:ajax. Pass datatable widget as parameter and try in there to determine which row is dragged?

Edit:

Idea4)

See Melloware comment here: https://github.com/primefaces/primefaces/issues/2457

Maybe it's possible to override function PrimeFaces.widget.DataTable.prototype.makeRowsDraggable so it ignore last 3 rows... could be complicated, not sure

Nikola
  • 554
  • 1
  • 4
  • 20