Yii Framework Forum: CJuiTabs - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CJuiTabs load views w/o ajax like CTabView Rate Topic: -----

#1 User is offline   Jaz Manister 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 109
  • Joined: 27-October 09
  • Location:Rural Western New York, USA

Posted 25 February 2010 - 12:34 PM

With CTabView, I specified tabs as follows:
$tabs = array(
  'start'=>array('title'=>'Start', 'view'=>'/mycontroller/start_form'),


But now, I'm looking at CJuiTabs and I can't tell simply from looking at the API page how to call a view like this.. it seems like I could load this view via ajax with a controller action for each view I want to use. This seems crazy since the CTabView lets me reference views directly without needing anything in the controller.

Can someone show me or link me to the way to use CJuiTabs with view files without using ajax or controller/actions?

Thanks.
0

#2 User is offline   wyldie 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 29
  • Joined: 22-May 09

Posted 25 February 2010 - 01:15 PM

try

$this->widget('zii.widgets.jui.CJuiTabs', array(
    'tabs'=>array(
        'StaticTab 1'=>$this->renderPartial("_partialView", array("foo"=>$bar), true),
    ),
    // additional javascript options for the tabs plugin
    'options'=>array(
        'collapsible'=>true,
    ),
));

untested though, should work
0

#3 User is offline   wyldie 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 29
  • Joined: 22-May 09

Posted 25 February 2010 - 01:18 PM

also. if you wanted to do it the AJAX way, then just add caching to the options array

'cache'=>true

0

#4 User is offline   Jaz Manister 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 109
  • Joined: 27-October 09
  • Location:Rural Western New York, USA

Posted 25 February 2010 - 01:48 PM

View Postwyldie, on 25 February 2010 - 01:15 PM, said:

try

$this->widget('zii.widgets.jui.CJuiTabs', array(
    'tabs'=>array(
        'StaticTab 1'=>$this->renderPartial("_partialView", array("foo"=>$bar), true),
    ),
    // additional javascript options for the tabs plugin
    'options'=>array(
        'collapsible'=>true,
    ),
));

untested though, should work



Yeah, you got it right there. That certainly does the trick.. a little sloppy in my opinion, but effective. Thanks, buddy.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users