jqautocomplete Ajax Powered Autocomplete Plugin for Yii -JQuery.js

  1. Requirements
  2. Usage
  3. Resources

This extension is a wrapper to use my own creation of Ajax Powered Autocomplete. Please, refer to my website to get a detailed description of this plugin.

Requirements

I have created this extension using the latest Yii but can be used from Yii 1.0 and above.

Usage

Unzip the file and:

  1. copy jqAutocomplete.php and jqautocomplete folder to your application's protected/extensions folder.

  2. copy test.php to your application's protected/views folder
  3. copy TestController.php to your application's protected/controllers folder
  4. copy test_layout.php to your application's protected/layouts folder

to run the test just do http://yourapplicationurl/index.php?r=test/autocomplete

Look at the view and you will see something like this:

Yii::import('ext.jqAutocomplete');

$json_options = array(
	'script'=> $this->createUrl('test/json',array('json'=>'true','limit'=>6)) . '&',
	'varName'=>'input',
	'shownoresults'=>true,
	'maxresults'=>16,
	'callback'=>'js:function(obj){ $(\'#json_info\').html(\'you have selected: \'+obj.id + \' \' + obj.value + \' (\' + obj.info + \')\'); }'	
);

// #test_json is your text field id 
// (please refer to the example view page for the field wrap)
jqAutocomplete::addAutocomplete('#test_json',$json_options);

Resources

1 1
11 followers
1 594 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: User Interface
Developed by: Antonio Ramirez
Created on: Oct 20, 2010
Last updated: 13 years ago

Downloads

show all

Related Extensions