Is their any way to display jquery inside cjuidialog because in my case it is not working. Following is my code to display jquery but it doen’t display anything
/** Start Widget **/
$this->beginWidget('zii.widgets.jui.CJuiDialog',array(
'id'=>'dialog-animation',
'options'=>array(
'title'=>'Dialog box - Animation',
'modal' => true,
'autoOpen'=>false,
'show'=>array(
'effect'=>'blind',
'duration'=>1000,
),
'hide'=>array(
'effect'=>'explode',
'duration'=>500,
),
),
));
$this->widget('zii.widgets.jui.CJuiTabs',array(
'tabs'=>array(
'StaticTab '=>'Content for tab 1',
'StaticTab With ID'=>array('content'=>'Content for tab 2 With Id' , 'id'=>'tab2'),
//following tab should show jquery jqplot meter(it is working if I use yiistrap modal but not in this case)
'Render Partial'=>array('id'=>'test-id','content'=>$this->renderPartial('_meter', true, true)),
// panel 3 contains the content rendered by a partial view
'AjaxTab'=>array('ajax'=>$this->createUrl('ajax')),
),
// additional javascript options for the tabs plugin
'options'=>array(
'collapsible'=>true,
),
'id'=>'MyTab-Menu',
));
$this->endWidget('zii.widgets.jui.CJuiDialog');
/** End Widget **/
echo CHtml::button('Open Dialog', array(
'onclick'=>'$("#dialog-animation").dialog("open"); return false;',
));
?>
I am not getting any error it’s just jquery is not working inside CJuidialog while same query is working fine if I display normally on a page or inside modal but not in Cjuidialog. Do you have any example jquery inside dialog window.
Do you see the ajax request in firebug? Also, often in ajax-request you have a duplicated id problem, try to give a unique id to the ajax-loaded components
The reason I not using this widget is because I couldn’t find any option of replot()(I had asked question about this earlier in forum). Normally if I have to display jqplot graph on a page the widget does the job but if I want to display the jqplot graph in dialog window or yiistrap modal window then I have to call replot() and then only graph is displayed. That is why I am calling this function in my code
Due to this reason I decided to directly use jqplot.js file for plotting graph. Also is their any advantage of using widget over jqplot.js file? I think only advantage is that widget makes coding job easier.
You can download jqplot.js and other related js file from [post=‘http://www.jqplot.com/’]Jqplot[/post]
I had include that files. I think you are not understanding my point. Using same code _meter.php I am able to display graph correctly on normal page or yiistrap modal window but not in cjuidialog. And not only jqplot graph even this simple jquery is not working in cjuidialog but working otherwise when displayed on nomral page or yiistrap modal.