Add to CJuiAutoComplete to zii.widgets.CMenu

Hey…

I want to add a CJuiAutoComplete to my zii.widgets.CMenu…

Any ideas? Help is appreciated!

Here are my code snippets:

zii.widgets.CMenu




$this->widget('zii.widgets.CMenu',array(

			'items'=>array(

				array('label'=>'Home', 'url'=>array('/site/index')),

				array('label'=>'About', 'url'=>array('/site/page', 'view'=>'about')),

				array('label'=>'Contact', 'url'=>array('/site/contact')),

				array('label'=>'Login', 'url'=>array('/user/login'), 'visible'=>Yii::app()->user->isGuest),

				array('label'=>'Register', 'url'=>array('/user/create'), 'visible'=>Yii::app()->user->isGuest),

				array('label'=>'MY Profile', 'url'=>array('/user/view/&id='.Yii::app()->user->id), 'visible'=>!Yii::app()->user->isGuest),

				array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/user/logout'), 'visible'=>(!Yii::app()->user->isGuest) ),

				

				

			),

		));



CJuiAutoComplete




Search

<?php

$this->widget('zii.widgets.jui.CJuiAutoComplete', array(

    'name'=>'city',

    'source'=>array('ac1', 'ab2', 'ab3'),

    // additional javascript options for the autocomplete plugin

    'options'=>array(

        'minLength'=>'2',

    ),

    'htmlOptions'=>array(

        'style'=>'height:20px;'

    ),

));

?>



I thought for a second, and still can’t figure why you want to do this? Why would you put a form and input element inside a list? Or you can just use CSS and move them beside your menu?

CMenu cannot do it.

Anyway, if you will take a look at the code of CMenu you will notice that are less than 300 lines of code, half of wich are comments.

You can extend cmenu or do without it in this case (writing the code of items).

Yeah thx…

I just wrote the menu myself since I’m really under time preassure!