TabViews do not display correctly

Hello, my trouble is while i try to load CTabView (or CJuiTabs) content into CJuiDialog using ajax, it doesn’t work correct, all HTML tags are ok, but no correct styles and js.

I have code like this for the VIEW:

$this->beginWidget('zii.widgets.jui.CJuiDialog', array(





        'title'=>'View order',




    echo 'dialog content here';


echo CHtml::link('open dialog', '#', array(

   'onclick'=>'$("#mydialog").load("/admin/orders/getorder/id/1").dialog("open"); return false;',


And this is for controller:

public function actionGetOrder()


	$orderId = $_GET['id'];

	$order = Order::model()->with('goods')->findByPk($orderId);


	if ($order!==null) $this->renderPartial('_orderForm',array('order'=>$order));

	else echo 'Wrong order ID';



_orderForm is a following view:

<?php $this->widget('CTabView', array(







        'tab2' => array(






I think the issue is because of i call renderPartial, which do not insert CSS and JS files which belongs to CTabView, or CJuiTabs into my layout. Am i right? So how to deal with this?

Register them manually before rendering the main view ?


I have the same problem. I build my own accordeon, de content is loaded through a AJAX call as soon as the user open a accordeon panel.

the accordeon panel has to be filled with a CJuiTab widget. But this is not working because it’s missing the correct CSS and JS files…

need help on this as well!

see also my topic:

Waiting for guru Qiang ::)

still waiting…

@Karasko: did you find a solution?

nope :angry:

@Qiang: pls, why can nobody give us an answer… really bad support

how to load a script file that you need for the CJuiTab widget manually…!?

not only you that feel hard to get fixed way when we found the problem. I’m too… in this forum many question that closed without the good answe

how to load the core script file for the CJuiTaab widget?

You have to do

$this->renderPartial('view', $params, false, true);

The fourth parameter in renderPartial has to be set to true. Read this renderPartial documentation

I had the same problem…

solution is to set a unique id to the ajax loaded element.

yii ids for elements are like yw0 etc.

on ajax call an assigned id could be assigned a second time to another element and so the new element couldn’t be initialized by jquery

I also had the same problem… no css and js…

you can simply add:


in your view file and it will work.

in my case the form tag does not appear in the dialog, simply disappears.

<?php $formx = $this->beginWidget('CActiveForm', array(

	'id' => 'verfpf-form',

	'action' => Yii::app()->createUrl("create"),

	'enableAjaxValidation' => false,

)); ?>

in each column has a button that appears Dialog, but the first button <form> Tagged disappears.

can someone help?