Thanks for your intention.
This is the view file where i have render another view in Moodal body
...
...
...
<?php $this->beginWidget('bootstrap.widgets.TbModal', array('id'=>'myModal')); ?>
<div class="modal-header">
<a class="close" data-dismiss="modal">x</a>
<h4>Add New Product:</h4>
</div>
<div class="modal-body">
<?php echo $this->renderPartial('//containerproduct/form', array('model'=>new Containerproduct,'c_id'=>$model->id)); ?>
</div>
<div class="modal-footer">
<?php $this->widget('bootstrap.widgets.TbButton', array(
'label'=>'Cancel',
'url'=>'#',
'htmlOptions'=>array('data-dismiss'=>'modal'),
)); ?>
</div>
<?php $this->endWidget(); ?>
<?php $this->widget('bootstrap.widgets.TbButton', array(
'label'=>'Add Product to this Container',
'type'=>'primary',
'htmlOptions'=>array(
'data-toggle'=>'modal',
'data-target'=>'#myModal',
),
)); ?>
The view file which i have rendered:
<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm',array(
'id'=>'containerproduct-form',
'type'=>'horizontal',
'enableAjaxValidation'=>true,
'clientOptions'=>array(
'validateOnSubmit'=>true,
),
)); ?>
<p class="help-block">Fields with <span class="required">*</span> are required.</p>
<?php echo $c_id;echo $form->errorSummary($model); ?>
<?php echo $form->hiddenField($model,'container_id',array('value'=>$c_id)); ?>
<div class='well'>
<?php echo $form->select2Row($model,'product_id',array('data'=>CHtml::listData(Product::model()->findAll(),'id','name'), 'options' => array('width'=>'33%'))); ?>
<?php echo $form->textFieldRow($model,'number',array('class'=>'span5','maxlength'=>10)); ?>
<?php echo $form->textFieldRow($model,'waste',array('class'=>'span5','maxlength'=>10, 'default'=>0)); ?>
<?php //echo $form->textFieldRow($model,'net',array('class'=>'span5','maxlength'=>10)); ?>
<div class="form-actions">
<?php $this->widget('bootstrap.widgets.TbButton', array(
'buttonType'=>'submit',
'type'=>'primary',
'label'=>$model->isNewRecord ? 'Create' : 'Save',
)); ?>
</div>
</div>
<?php $this->endWidget(); ?>
And In the Controller i have not done any change.
Snap is added also…