How to bind javascript event to jquery tabs with CJuiTabs

The following code does not work.


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

    'tabs'=>array(

        'StaticTab 1'=>'Content for tab 1',

        'StaticTab 2'=>array('content'=>'Content for tab 2', 'id'=>'tab2')

    ),

    'options'=>array(

        'load'=>'function(event, ui) { ... }',

    ),

));

I know the answer now. It should be


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

    'tabs'=>array(

        'StaticTab 1'=>'Content for tab 1',

        'StaticTab 2'=>array('content'=>'Content for tab 2', 'id'=>'tab2')

    ),

    'options'=>'js:{load:function(event, ui) { ... }}',

));

Great liang how can change text.val() on tab’s click event ?

Thanks

I test the code:




'options' => 'js:{load:function(event, ui) {

        var $tabs = ui.tab;

        alert(\'u have select tab=\'+$tabs);}}'

    ,

return me this alert:

[color="#808000"]u have select tab=http://127.0.0.1/sitename/index.php?r=tirger/view&id=7#6[/color]

I’m interested in the last number after the hash mark (6) how can retrieve it ? Explode string on # char, or there is a cleaner way ?

Check the value of


window.location.hash

but this gets the value of the current page URL