~fusonic/chive/1.1

« back to all changes in this revision

Viewing changes to yii/web/widgets/CAutoComplete.php

  • Committer: Matthias Burtscher
  • Date: 2010-02-12 09:12:35 UTC
  • Revision ID: matthias.burtscher@fusonic.net-20100212091235-jqxrb62klx872ajc
* Updated Yii to 1.1.0
* Removed CodePress and CodeMirror
* Updated jQuery and some plugins
* Cleaned some code ...

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 *
5
5
 * @author Qiang Xue <qiang.xue@gmail.com>
6
6
 * @link http://www.yiiframework.com/
7
 
 * @copyright Copyright &copy; 2008-2009 Yii Software LLC
 
7
 * @copyright Copyright &copy; 2008-2010 Yii Software LLC
8
8
 * @license http://www.yiiframework.com/license/
9
9
 */
10
10
 
14
14
 * CAutoComplete is based on the {@link http://plugins.jquery.com/project/autocompletex jQuery Autocomplete}.
15
15
 *
16
16
 * @author Qiang Xue <qiang.xue@gmail.com>
17
 
 * @version $Id: CAutoComplete.php 913 2009-04-04 02:01:48Z qiang.xue $
 
17
 * @version $Id: CAutoComplete.php 1678 2010-01-07 21:02:00Z qiang.xue $
18
18
 * @package system.web.widgets
19
19
 * @since 1.0
20
20
 */
179
179
        /**
180
180
         * @var array additional options that can be passed to the constructor of the autocomplete js object.
181
181
         * This allows you to override existing functions of the autocomplete js class (e.g. the parse() function)
 
182
         *
 
183
         * If you want to provide JavaScript native code, you have to prefix the string with js: otherwise it will
 
184
         * be enclosed by quotes.
182
185
         */
183
186
        public $options=array();
184
187
        /**
196
199
        public function init()
197
200
        {
198
201
                list($name,$id)=$this->resolveNameID();
199
 
                $this->htmlOptions['id']=$id;
200
 
                $this->htmlOptions['name']=$name;
 
202
                if(isset($this->htmlOptions['id']))
 
203
                        $id=$this->htmlOptions['id'];
 
204
                else
 
205
                        $this->htmlOptions['id']=$id;
 
206
                if(isset($this->htmlOptions['name']))
 
207
                        $name=$this->htmlOptions['name'];
 
208
                else
 
209
                        $this->htmlOptions['name']=$name;
201
210
 
202
211
                $this->registerClientScript();
203
212
 
204
 
 
205
213
                if($this->hasModel())
206
214
                {
207
215
                        $field=$this->textArea ? 'activeTextArea' : 'activeTextField';