state-jui-accordion Custom CJuiAccordion extension to enable it to remember state (navigation=true)

I was having problems in creating an accordion menu which remembered state. Setting navigation to true in options didn't help.

After some time of debugging, I realised that the default CJuiAccordion class outputs the head sections as links with href as #, which causes navigation not to work. Even if you were to put "<a href='?r=blah'>A Header</a>" as the key, it wouldn't work either as it will create ANOTHER href with #.

So I wrote a quickie custom class to enable accordion menus which remember state.

Documentation

Requirements
  • Yii 1.1 or above
Installation
  • Extract the release file under protected/components
Usage

See the following code example: ~~~ For example: '?r=site' will be used as the anchor link for the Home panel.

[php] $this->widget('StateCJuiAccordion', array(

    'panels'=>array(
        "Home"=>array('href'=>'?r=site', 'content'=>$home_menu),
        "Panel 2"=>array('href'=>'?r=p2', 'content'=>$p2_menu),
    ),
    'options'=>array(
    	'navigation'=>true,
    	'active'=>false,
    ),


##Change Log

###March 23, 2010
* Initial release.

0 0
4 followers
639 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: User Interface
Tags:
Developed by: Angelystor
Created on: Mar 23, 2010
Last updated: 14 years ago

Downloads

show all