Possible bug combining rowReorder and rowGroup
Possible bug combining rowReorder and rowGroup
bbrala
Posts: 8Questions: 2Answers: 0
When combining rowReorder and rowGroup when dragging an element up to the stop of the table it ends up above the top row, which is pretty weird. This seems lik a bug?
Drag a row to the top of the table.
https://jsfiddle.net/6tnn7j24/1/
This discussion has been closed.
Answers
Something to add tot this, when you drag a sort over a rowGroup header it doesn't understand it was dragged over the first of the group, which then breaks the order it comminucates. So when i drag it to the first row below the rowgroup header it gives it the order of the last of the previous group +1.
Ok, diving into the code, it seems the source of these problems is the fact rowGroup inserts rows that are not returned bt dt.rows(), therefor the rowReorder doesnt know the rows exist, and breaks.
If you look at the code for dataTables.rowReorder.js line 215
dt.rows( { page: 'current' } ).nodes().toArray()
This will never return the headers, so it doesn't know about those positions. When you drag over a header it will not update positions, and therefor things get out of order.
Hi,
Thanks for posting this. I agree - there is a bug in the integration between the two of them. I don't think I'll manage to get it into the next release, but I'll get it into the one after that.
Allan
Thanks, glad to head that. I would help, but this fix would require quite a lot of knowledge of the internals which i dont have.
Hi @allan
Have you had any chance to look at this? Been a while
Best regrards, Bjorn.
Not yet sorry - busy times just now. I'll keep this tab open to try and get to it as soon as I can.
Allan
Thanks allan, hopefully you find the time soon.
We would really like this to be fixed as well, is there any way we can contribute? The combination of rowreorder and rowgroup is not usable like this.
One addition as well: When dragging an item from one group to the middle or bottom of another group sometimes the item ends up as the first item in the group instead of the desired location.