Issue
I have a custom button in CGridView. There's a click event where by I have to pass the id of the row to the controller action in order to do a query.
'options' => array(
'ajax' => array(
'type' => 'POST',
'url' => "js:$(this).attr('href')",
'success' => 'function(data){
$("#detail").html(data);
$("#detail-dialog").dialog("open"); return false;
}',
'update' => '#detail'
)
)
Once I get the result from the controller action, I open a dialog box. I want to have that data assigned to a PHP variable because I will need it in order to loop and create a CJuitabs inside the CJuiDialog. instead of doing $("#detail").html(data);
In the same file uner the CGridView, I have this CJuiDialog script that pops out.
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
'id' => 'detail-dialog',
'options' => array(
'title' => 'Dialog Box Title' . $data->id,
'autoOpen' => false,
'modal' => true,
'width' => 550,
'height' => 450,
),
)); ?>
<div id="#detail></div>
<?php
$this->endWidget();
?>
I want to put CJuitabs inside that CJuiDialog and I need to loop some data for producing the number of tabs dynamically.
How do I assign that ajax data
to a php variable ?
Solution
I solved my problem by generating the whole CJuiTabs from the controller and fed the view file that calls a javascript that fires the CJuiDialog box
Answered By - sasori
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.