Drop Down Widget
Dropdown is a common user interface. Drop down Nedil widget is capable of generating it's content from JSON or Select HTML element.
Basic Usage $.domLoaded(function() { $.get("#drp").widget("dropdown", CONFIG_JSON ); }
Configuring Options
It contains array of JSON objects. The properties are mentioned below.
Methods
DropDown Widget Examples Example 1
JS
HTML
$.domLoaded( function() { $.get("#parent1").widget("dropdown", { source : [{ value : "1", text : "First"}, { value : "2", text : "Second"}, { value : "3", text : "Third" }, { value : "4", text : "Fourth" }, { value : "5", text : "Fifth", selected : true}, { value : "6", text : "Sixth" }, { value : "7", text : "Seventh"}, { value : "8", text : "Eight" }, { value : "9", text : "Ninth" }], dim : { wid : 200}, name : "Location", onchange : function(val) { alert("Selected Value is " + val); } }); $.get("#parent2").widget("dropdown", { source : "#sour", dim : { wid : 200} }); });
Result
Example 2
JS
HTML
$.domLoaded( function() { var tab; tab = $.get("#parent2").widget("dropdown", { source : "#sour", dim : { wid : 200}, enabled : false }); $.get("#sel1").on("click", function() { tab.enable(); }); $.get("#sel2").on("click", function() { tab.disable(); }); });
Result
| |||||||||||||||||||||||||||||||||||||||||||||||||||||