I am looking for a method for a jQuery-like sortable list ( link ), but with some elements in fixed underdeveloped positions.
It is trivial that some elements are not available, but their positions do not remain fixed, because the number of elements to be dragged higher and lower can change.
To be more specific: I have a list of 10 items in ranking order. I want the user to be able to change the ranking for some items by dragging (sortable list) but not changing the rank of other frozen items. The standard jQuery sorting function for sorting allows you to change the rank of frozen items by changing the number of items above or below frozen items.
I tried to do this manually by sorting through the list items while dragging and dropping. Ie, when a list item is dragged over an unfrozen item, the position of the two items is replaced. This gives the semantics that I want, but the item being dragged noticeably βjumpsβ between its new position and the current βdragβ position. (I want it to stay in the current drag position, only its position in the DOM should change. But when the DOM position changes, the coordinates of the drag offset must be recalculated. And I donβt know how to change the position of the DOM and change the shift coordinates of the shift atomically. preventing redrawing between them. Nowadays, sometimes there is a redrawing between them, and the element noticeably, although soon, skips.)
Edit Here jsfiddle shows my manual approach: link . Play with him for a while and you will notice the flicker / jumps that I mentioned.
source share