How to display images in CJuiAutoComplete without extenstions

Comparing #4 with #5

Revision #5 was created by samdark samdark on Jan 20, 2019, 9:03:57 PM.

Set version

Yii version

1.1

Tags

AJAX,jquery,CJuiAutoComplete, ajax, jquery

Content

[...]
![autocomplete thumb](http://media-cache-ec0.pinimg.com/736x/e5/63/16/e563163b9de20b24c1d1a49306f0089d.jpg "Autocomplete with thumb Example ")


Here is what you can do in a very simple way, in your model controller:


```php

// In the access rules function
public function accessRules()
[...]
In your view file _In my case it was _form_:


```php

<?php
$this->widget('zii.widgets.jui.CJuiAutoComplete', array(
'attribute' => 'color', // replace color with the attribute name
'model'=>$model,
'sourceUrl'=> '?r=colorCode/getColorAjax', // replace getColorAjax with your function name
[...]