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(

    'id'=>'mydialog',

    'options'=>array(

    	'width'=>500,

    	'height'=>500,

        'title'=>'View order',

        'autoOpen'=>false,

    ),

));


    echo 'dialog content here';


$this->endWidget('zii.widgets.jui.CJuiDialog');


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(

	'viewData'=>array('order'=>$order),

    'tabs'=>array(

    	'tab1'=>array(

	        'title'=>'Order',

	        'view'=>'_orderDetails'

        ),

        'tab2' => array(

        	 'title'=>'Cart',

        	 'content'=>'Content',

        ),

    ),


));



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: http://www.yiiframework.com/forum/index.php?/topic/7357-yiiapp-cjuiwidget-registercorescripts/page__hl__%20%20Yii::app()-__fromsearch__1

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:


 $("#id_of_your_tab").tabs(); 

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?