back to web

Drag List

 

Get it on GitHub

 

 

Nothing fancy about this simple drag list. Just initialize, drag items, then check for changes. Can also be used for re-ordering. Just one js file and a css file. The js file is somewhat commented but to figure things out it'll be fastest to just start with the below example and see what each method spits out.

 

Methods:

addHolder(id,title,colour)
addItem(holder,id,label)
getHolderItems(holder)
revertItems()
getChanges()
getHolderOrder(holder)

 

Usage:

 

dl = new DragList("dragholder");
dl.addHolder("col1","Column One","lightblue");
dl.addHolder("col2","Column Two","lightgreen");
dl.addHolder("trash","Trash");
dl.addItem("col1","appl","Apple");
dl.addItem("col1","pear","Pear");
dl.addItem("col1","bana","Banana");
dl.addItem("col1","bkby","Blackberry");
dl.addItem("col2","strw","Stawberry");
dl.addItem("col2","pech","Peach");
dl.addItem("col2","plum","Plum");