This is Yii autocomplete extension using Jquery Ui. It enables users to quickly find and select from a pre-populated list of values as they type, leveraging searching and filtering.
- Tested with Yii 1.1.14
- Jquery 1.10.2
- Jquery Ui 1.10.4 or above
- Download the latest release package
- Unpack it in /protected/extensions/ folder
- Paste the code into your view file
<?php
$this->widget('ext.YiiComplete.YiiComplete', array(
'jsonUrl' => '<url with json data(http://www.site.com/controller/JsonAction)>'
));
?>
- Json data should be in format:
[
{
"id": 1,
"label": "Car1",
"value": "Saab"
},
{
"id": 2,
"label": "Car2",
"value": "Audi"
},
{
"id": 3,
"label": "Car3",
"value": "Honda"
},
...
etc
]