Wasim
Wasim

Reputation: 896

Draggable , droppable and sortable

I am new to JQuery.... Recently i was working on a project and i faced the following problem:

I have two ul (say: gallery(LHS) and trash(RHS)) .

In gallery i have 8 li's and they are draggable and sortable. I can drag and drop the li's to trash. I can even sort them in trash.

the problem i am facing is with the placement of this li's Actually, initially the trash is empty but has a background image with 8 rectangular boxes and each rectangular box has a serial number in it.(mind it.. the 8 rectangular boxes are merely a single image).

So whenever I drop the first li into the trash, the first rectangular box hides behind the li. when I drop the second one, the second box hides and so on.....

Now i want that when i drag the first li from gallery onto the 8th rect. box of the trash it stays there instead of moving upwards as it is a single container.

Someone suggested me to use 8 different containers. But the problem is can i make this 8 container sortable. I need a draggable,droppable on a particular container and sortable li's within that 8 container.

Upvotes: 1

Views: 523

Answers (1)

Peter
Peter

Reputation: 14098

You could work with 8 different containers, as suggested. Then when the user drops something on container 8, you could put the value on which you want to sort, in the container. Then, when the users wants to sort, sort the 8 containers.

If this isn't clear enough, maybe post some (simplified) code, and I'll see if I can help you out.

Upvotes: 1

Related Questions