RowReorder between pages

RowReorder between pages

jgessingerjgessinger Posts: 38Questions: 6Answers: 0
edited July 2016 in RowReorder

Hello Allan,

I am using the RowReorder feature in my editor instance. Its basically really working great. I have some short tables with about 20 entries and disabled the paging there for a better usability.
My problem: I have another table with about 400 entries and when I disable the paging the, the reorder feature works really slow, because of the many items. So I have to enable it there. The main problem is to order with drag&drop the rows between the pages then. Is there a good solution to get this work? The same problem is on your example page: https://editor.datatables.net/examples/extensions/rowReorder.html
You cant order from one page to another. One solution would maybe be to enable the order field in editing mode, but it would be easier with drag&drop.

Replies

  • allanallan Posts: 63,482Questions: 1Answers: 10,467 Site admin

    Hi,

    Thanks for noting this. I'm afraid it is indeed an issue - in fact a known one.

    There isn't a good way to fix this yet. I'm actually not even sure what the correct UI for this is yet - possibly a "previous page" box at the top of the table and "next page" box at the bottom which, when dragged over would flick the paging. But that adds quite a lot of complexity since one of the rows is being dragged around the page.

    Allan

  • jgessingerjgessinger Posts: 38Questions: 6Answers: 0

    Or you convert the page number containers to drop-zones or something like this. In the first step it would be great to just have the basic functionality. Features like dynamically change to a page on hover isnt a must have for me atm. Wouldnt it be easier just to listen to the drop event on a page container and the reload the table?

  • allanallan Posts: 63,482Questions: 1Answers: 10,467 Site admin

    Yes that is certainly an option - although changing the paging can cause different numbers to appear in the paging control which might complicate that slightly.

    Allan

  • jgessingerjgessinger Posts: 38Questions: 6Answers: 0

    Maybe it would be a workaround to optionally add arrows to reorder an item. When clicking the down arrow on the last item of the page, it will be ordered to the next page.

  • allanallan Posts: 63,482Questions: 1Answers: 10,467 Site admin

    That would certainly be an option - thanks for the suggestion.

    I think the main issue with redrawing the table while dragging the row is if DataTables attempts to redraw the page that the row is currently displayed on (i.e. drag start on page 1, switch to page 2 and then back to 1) is that DataTables' draw will insert the row in to the DOM, rather than leaving it with the drag (although the next mouse movement would pull it back out).

    I think that interaction could potentially be fairly complex. Your suggestion might provide a workaround.

    Allan

  • anthonysanthonys Posts: 19Questions: 4Answers: 0

    This is something my customers have been asking for. My current suggested workaround for them is to change the number of rows displayed so that the 'join' is shown and for them to move the item over the join.

    I use a move icon handle to let people pick up rows. I'm thinking about a little up down ticker next to it could let them pass things from the bottom of one page to the top of the next.

  • jamesondjamesond Posts: 1Questions: 0Answers: 0

    Was there ever any progress on this or a newer solution? If I click to page two and reorder it treats it as if its item 2 and not 12? I was hoping it would go 12 to 11 not 2 to 1. Thank you for the great plugin.

  • allanallan Posts: 63,482Questions: 1Answers: 10,467 Site admin

    Hi,

    I'm afraid I've not managed to progress this yet. Its still on my radar, but I'm working on other aspects of DataTables at the moment.

    Regards,
    Allan

This discussion has been closed.