rowReorder on restricted row types

rowReorder on restricted row types

esaboraesabora Posts: 15Questions: 1Answers: 0

Hello,

we want to use the drag & drop functionnality with the rowReorder attribute, but we want to restrict it to only one business kind of row.
our one example is:
We'got a datatable with one item/article by row. We can insert in the table a specific kind of row named 'Page jump' (use to get a customised printable version of the datatable).
So, all the item/article row must NOT be drag & drop able. Only the 'page jump' row must be drag & drop able.

So, the rowReorder attribute have to be restricted.
I don't think any rowReorder event can help us to this task.

I wonder if we could have the same behaviour as columnDefs and its orderable attribute, or any other solution.

thanks for the answer

Replies

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin

    Hi,

    The rowReorder.selector option is probably the best way to do this. You would use something like:

    rowReorder: {
      selector: 'tr.reorderable td:first-child'
    }
    

    i.e. restrict the RowReorder listener to only rows with the class reorderable (update as you need!).

    One very important point to make though is that when RowReorder does its data swap, it makes no distinction between row types. The data for all rows in between and including the drag start and drop points will be updated.

    Regards,
    Allan

  • esaboraesabora Posts: 15Questions: 1Answers: 0

    Thx Allan, the selector work fine !

This discussion has been closed.