Yii Framework Forum: Pasar CGridView id a CJuiDialog form - Yii Framework Forum

Jump to content

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

Pasar CGridView id a CJuiDialog form Rate Topic: -----

#1 User is offline   chango08 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 19-September 14

Posted 08 October 2014 - 08:19 PM

Intento pasar el id de una fila de un Cgridview a un form en un Cjuidialig. No puedo tomar el parametro y asignarlo al
$model->id. Muchas gracias.

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'llamada-recurso-grid',
	'dataProvider'=>$model->search($model->llamadas_id1),
	'filter'=>null,
	'columns'=>array(
              'id',
              array(
			'header'=>'LIBERAR', 
                    'htmlOptions'=>array('style'=>'padding: 3px 18px 4px;'),
                    'class'=>'CButtonColumn',
                    'template'=>'{liberar}',
                    'buttons' => array(
               'liberar' => array( //the name {recursos} must be same
                 'label' => 'Liberar',
                   'imageUrl' => Yii::app()->baseUrl . '/images/liberar.png',
                   'options' => array('id' => $data["id"]),
                   'click'=>'function(){
                                $("#mydialog").data("idLlamadaRecurso",$(this).attr("id")).dialog("open");  
                                return false;
                            }', 
                   ),),
		),
	),
)); ?>


$this->beginWidget('zii.widgets.jui.CJuiDialog',array(
    'id'=>'mydialog',
    // additional javascript options for the dialog plugin
    'options'=>array(
        'title'=>'Liberar Recurso',       
        'width'=>480,
        'height'=>400,
        'autoOpen'=>false,
        'close'=>"js:function(){
            $('#mydialog').removeData('idLlamadaRecurso');
        }",
    ),
));
?>



<?php $this->endWidget(); ?>
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'llamada-recurso-form',
	'enableAjaxValidation'=>false,
)); ?>

	<?php echo $form->errorSummary($model);         
        ?>
        <div class="row">
		<?php echo $form->labelEx($model,'id'); ?>
		<?php echo $form->textField($model,'id'); ?>
		<?php echo $form->error($model,'id'); ?>
	</div>
</div> 

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



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