AutoComplete Widget
Autocomplete is similar to dropdown but it accepts user's input and provides suggestions based on that. Autocomplete Nedil widget is capable of generating it's content from JSON or Select HTML element or AJAX Reponse. If AJAX is used, the filtering based on user's input should be done in the server side.
Basic Usage $.domLoaded(function() { $.get("#drp").widget("autocomplete", 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("autocomplete", { source : ["Senthilnathan", "Ganesh", "Rajesh", "Shanmugavel", "Raju", "Kumar Sent", "Iqbal", "Viji", "Vishnu"], dim : { wid : 200}, name : "Users", watermark : "Enter User Names" }); $.get("#parent2").widget("autocomplete", { source : ["Senthilnathan", "Ganesh", "Rajesh", "Shanmugavel", "Raju", "Kumar Sent", "Iqbal", "Viji", "Vishnu"], dim : { wid : 200}, name : "Users", strict : true, watermark : "Strictly User Names" }); });
Result
Example 2
JS
HTML
$.domLoaded( function() { $.get("#parent1").widget("autocomplete", { source : $.Ajax({url: "../../ajax/AjaxServer.php", cache : false}), param : { "example" : 5 }, dim : { wid : 200}, name : "Users", strict : true, watermark : "Ajax User Names" }); });
Result
Example 3
JS
HTML
$.domLoaded( function() { var tab = $.get("#parent1").widget("autocomplete", { source : ["Senthilnathan", "Ganesh", "Rajesh", "Shanmugavel", "Raju", "Kumar Sent", "Iqbal", "Viji", "Vishnu"], dim : { wid : 200}, name : "Users", watermark : "Enter User Names", enabled : false }); $.get("#sel1").on("click", function() { tab.enable(); }); $.get("#sel2").on("click", function() { tab.disable(); }); });
Result
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||