Closed (fixed)
Project:
DraggableViews
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
7 Aug 2009 at 18:47 UTC
Updated:
19 Aug 2009 at 10:03 UTC
Hello,
I just set up Draggable Views to use with Flag Weight module to create a Netflix-like Queue where users can add videos to their Queue and reorder it as they want. One cool feature that Netflix has is "move to top of queue". This gives users the ability to move something from page 5 of their queue to the top of page 1.
Is this possible to implement with Draggable Views?
Is there another way to move items between pages?
Thanks,
Andrey.
Comments
Comment #1
sevi commentedAll you have to do is setting the order value to -1. This will cause draggableviews to rebuild the structure (because -1 is an illegal order value). While rebuilding the structure all nodes will be sorted according to their current order values (even if they're illegal) before they become renumbered. So your node with order value -1 will appear on top.
If you used native handler you would have to set the order value of the certain node manually:
Setting the flag_weights value works similar..?
Greetings,
sevi
Comment #2
mr.andrey commentedAh, very interesting. Thanks for the reply.
So after it gets resorted the -1 changes into a valid number (0,1, etc), so the next time I set the order value to -1, it will just go to the top?
Is there a way to have this whole operation be done in ajax without reloading the page? Change the order value, refresh the page, and stay on whatever page number in the views I was on?
Thanks,
Andrey.
UPDATE: Just tested this for flag weights and it works. If I set the flag weight in `flag_content` to -1, it reorders the structure as you said. -1 becomes 0 and the table gets reordered.
So to modify your query for flag weights:
Depending on where that query goes, I can also use the `fcid` column.
Comment #3
sevi commentedI created a new module for stuff like this.
Please re-create this issue at DraggableViews Navigator.
Greetings,
sevi