inputEx - DDList Widget Usage

Basic DDList Widget creation

Use the following code to create a basic inputEx DDList Widget.

new YAHOO.inputEx.widget.DDList({parentEl: 'container1', value: ['I was in first position !', 'I\'m second.', 'Third element']});

Numbered list

Display the item # by changing CSS style only :

new YAHOO.inputEx.widget.DDList({id:'numberedList', parentEl: 'container2', value: ['I was in first position !', 'I\'m second.', 'Third element']}); /* Style */ #numberedList li { list-style-type:decimal; margin-left:20px; }

itemRemoved Event

Use the following code to listen for the itemRemoved Event:

var list = new YAHOO.inputEx.widget.DDList({parentEl: 'container3', value: ['I was in first position !', 'I\'m second.', 'Third element']}); list.itemRemovedEvt.subscribe(function() { alert("removed !"); });

listReordered Event

Use the following code to listen for the listReordered Event:

var list = new YAHOO.inputEx.widget.DDList({parentEl: 'container4', value: ['I was in first position !', 'I\'m second.', 'Third element']}); list.listReorderedEvt.subscribe(function() { alert("reordered !"); });