stat
stat

Reputation: 669

drag and drop list of objects on a grid

I'm building a webapp (on django) where I'm asking the user to provide the following:

number of rows: x

number of columns: y

interactively let the user decide the rows and columns labels

and a list of objects to be pulled into the virtual grid

let's take the example of 3 columns, 4 rows with labels Column i (i=1..x), Row j (j=1..y), and 3 objects named "red" "black" "grey"

with these I would like to have a drag and drop object interaction on an automatically build grid.

when pulling blocks from the pool of objects, they can be placed in the boxes of the grid without removing them from the pool (the objects are infinite). So basically the user can fill everything with red, a mix of the 3 colors, some filled and some empty, and so on..

Screenshot example can be found here: https://i.sstatic.net/RJAQy.jpg

DO you know if there is something already created with this purpose? I took a look at the library "draggable" but none of the examples really fit my case.

Hope you can help.

If it was not clear, I'm still in the learning phase.

Upvotes: 0

Views: 834

Answers (1)

vishnu sandhireddy
vishnu sandhireddy

Reputation: 1176

You could use HTML5DnD https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API It has API's to configure the items to be dragged and items to be dropped.

Upvotes: 1

Related Questions