Cjuidialog Conflicting With Each Other

Hello yiiers,

i have getting a strange problem using cjuidialog.

i am trying to add/edit/delete/update using cjuidialog it works fine but problem arise with a following scenerio.

  1. when clicking on add button cjuidialog opens and renders _form view (works fine) (with fix width and height)

  2. but i have functionality like “select account” in that view so when i click on that “select account” another cjuidialog box opens and loading a cgridview under it… (it works fine) but this cjuidialog box that opened from its parent cjuidialog’s width and height is changing automatically. sometimes it is opening on top of parent dialog (its fine) but sometimes it is opening below of parent cjuidialog so i cannot see that content of that cjuidialog cause it is behind parent cjuidialog.

it is frustrating as i am not getting any errors too. may be there will be some settings that need to be done?

please shed some lights on it… please please please…

I think you need to give a unique ID for each?

Are you opening the dialog with the modal setting?

http://jqueryui.com/dialog/#modal

This should make it always on top.

@checkout01 i have already given a unique id but still it is behaving strange.

@alex-w http://jqueryui.com/dialog/#modal it shows to set modal dialog which i have done already but i want to open another pop up from popup it is opening fine but width and height of parent popup is changing and it is not preserving.

i am pasting all the code here.

leads/leads/admin




<?php

$this->beginWidget( 'zii.widgets.jui.CJuiDialog', array(

  'id' => 'delete-dialog',

  'options' => array(

    'title' => 'Dialog',

    'autoOpen' => false,

    'modal' => true,

    'width' => '900',

	'height'=>'500',

    'resizable' => true,

	'close' => 'js:function(ev, ui) { Loading.hide(); }',

  ),

)); ?>

<div class="delete-dialog-content"></div>

<?php $this->endWidget(); ?>




<div class="gridborder">

	<div class="headblock">&nbsp; </div>

    <div class="restthing">

		<?php $this->widget( 'ext.EUpdateDialog.EUpdateDialog', array(

          'height' => '500',

          'resizable' => true,

          'id'=>'lead_update',

          'width' => '1010', )); ?>

          

          <?php $box = $this->beginWidget('bootstrap.widgets.TbBox', array(

'title' => 'Manage Leads',

'headerIcon' => 'icon-eye-open',

// when displaying a table, if we include bootstra-widget-table class

// the table will be 0-padding to the box


));?>


  

            <?php $this->widget('bootstrap.widgets.TbButton', array(

    'label'=>'Add Leads',

	'url' => array( 'create' ),

	'icon' => 'icon-plus',

    'type'=>'', // null, 'primary', 'info', 'success', 'warning', 'danger' or 'inverse'

    'size'=>'small', // null, 'large', 'small' or 'mini'

	'htmlOptions'=>array('class'=>'update-dialog-create submitbutton formlink'),


)); ?>

<?php $this->widget('bootstrap.widgets.TbButton', array(

    'label'=>'Delete',

	'url' => array( 'leads/leads/deletemul' ),

	'icon' => 'icon-trash',

    'type'=>'', // null, 'primary', 'info', 'success', 'warning', 'danger' or 'inverse'

    'size'=>'small', // null, 'large', 'small' or 'mini'

	'htmlOptions'=>array('class'=>'delete-dialog-create submitbutton formlink'),


)); ?>

<?php $this->widget('bootstrap.widgets.TbButton', array(

    'label'=>'Import Accounts',

	'url' => '#',

	'icon' => 'icon-upload',

    'type'=>'', // null, 'primary', 'info', 'success', 'warning', 'danger' or 'inverse'

    'size'=>'small', // null, 'large', 'small' or 'mini'

	//'htmlOptions'=>array('onclick'=>'Loading.show();$("#importaccount-dialog").dialog("open"); Loading.hide(); return false;'),


)); ?>

<?php $this->widget('bootstrap.widgets.TbButton', array(

    'label'=>'Export Leads',

	

	'url' => '#',

	'icon' => 'icon-download',

    'type'=>'', // null, 'primary', 'info', 'success', 'warning', 'danger' or 'inverse'

    'size'=>'small', // null, 'large', 'small' or 'mini'

	'htmlOptions'=>array('onclick'=>'$("#exportlead-dialog").dialog("open"); return false;'),


)); ?>

                 

                 <?php 

				 $this->widget('bootstrap.widgets.TbGridView', array(

					'type'=>'striped bordered condensed',

					'id'=>'Lead-grid',

					'dataProvider'=>$model->search($id),

					'filter'=>$model,

					'cssFile'=>false,

					'selectableRows'=>'2',

					'pager' => array(

								'cssFile'=>false,

								'nextPageLabel' => '&rsaquo;',

								'prevPageLabel' => '&lsaquo;',

								'firstPageLabel' => '&laquo;',

								'lastPageLabel' => '&raquo;',

								'header' => false,

								'maxButtonCount' => 5,

					),

				   "template" => "{pager}{summary}{items}{pager}", 

				   'columns'=>array(

				   array(

					  'class'=>'CCheckBoxColumn',

					  'id'=>'selectedItems',

				    ),

					

					array(

            			 'header'=>'Full Name',

            			 'value'=>'$data->first_name." ".$data->last_name',

           			 ), 

					

					//'first_name',

					'status',

						

					array(

							'name'=>'acc_id',

							'value'=>'$data->acc->acc_name',

					),

				

					'email_address',

					'phone_office',

					array(

							'name'=>'created_by',

							'value'=>'$data->createdBy->username',

					),

					array(

							'name' => 'date_enter',

							'value' => 'date("d.m.Y H:i:s",$data->date_enter)',

					),

					/*array(

							'header'    => 'View',

							'class'     => 'viewdetail',

							'attribute' => 'lead_id',  

					),*/

					/*array(

							'header'    => 'View',

							'class'     => 'viewdetail1',

							'attribute' => 'lead_id',  

					),*/

					array(

							'header'    => 'Action',

							'class'=>'bootstrap.widgets.TbButtonColumn',

							'template' => '{view}{update}{delete}',

							'viewButtonUrl' => 'Yii::app()->createUrl("/leads/leads/viewleadsdetail1", array( "id" => $data->lead_id ) )',

							'deleteButtonUrl' => 'Yii::app()->createUrl("/leads/leads/delete", array( "id" => $data->lead_id ) )',

						    'deleteConfirmation'=>false,

						    'buttons' => array(

						                     'delete' => array(

						                         

						                          'click' => 'updateDialogDelete',

						                      ),

						                     'update' => array(

						                           'click' => 'updateDialogUpdate',

						                      ),

			                ),

					),

				),

			  )); ?>

              

              <div  style="text-align:right; padding:10px;" >

  <?php $this->widget('bootstrap.widgets.TbButton', array(

    'label'=>'Delete',

	'url' => array( 'accounts/deletemul' ),

	'icon' => 'icon-trash',

    'type'=>'', // null, 'primary', 'info', 'success', 'warning', 'danger' or 'inverse'

    'size'=>'small', // null, 'large', 'small' or 'mini'

	'htmlOptions'=>array('class'=>'delete-dialog-create submitbutton formlink'),


)); ?>


                            

          </div>

     <?php $this->endWidget();?>  

       

<?php

Yii::app()->clientScript->registerScript( 'deleteDialogCreate', "

jQuery( function($){

       $( 'a.delete-dialog-create' ).bind( 'click', function( e ){

           e.preventDefault();

           $( '#delete-dialog' ).children( ':eq(0)' ).empty();

	       var selectionIds = $.fn.yiiGridView.getSelection('Lead-grid');

	   

    	    if (selectionIds.length!==0) {

            deleteDialog( $( this ).attr( 'href' ) );

             $( '#delete-dialog' )

             .dialog( { title: 'Delete Multiple' } )

             .dialog( 'open' );

		    }

		    else

		    {

			     alert('No Record Selected..');

		     }

      });

});

" );

?>


<?php

$updateJS = CHtml::ajax( array(

  'url' => array('leads/deletemul'),

  'data' => 'js:$(this).serialize() + action',

  'type' => 'post',

  'dataType' => 'json',

  'success' => "function( data )

  {

    if( data.status == 'failure' )

    {

      $( '#delete-dialog div.delete-dialog-content' ).html( data.content );

	  Loading.hide();

      $( '#delete-dialog div.delete-dialog-content form input[type=submit]' )

        .die() // Stop from re-binding event handlers

        .live( 'click', function( e ){ // Send clicked button value

          e.preventDefault();

          deleteDialog( false, $( this ).attr( 'name' ) );

      });

    }

    else

    {

      $( '#delete-dialog div.delete-dialog-content' ).html( data.content );

	  Loading.hide();

      if( data.status == 'success' ) // Update all grid views on success

      {

        $( 'div.grid-view' ).each( function(){ // Change the selector if you use different class or element

          $.fn.yiiGridView.update( $( this ).attr( 'id' ) );

        });

      }

      setTimeout( \"$( '#delete-dialog' ).dialog( 'close' ).children( ':eq(0)' ).empty();\", 1000 );

    }

  }"

)); ?>


<?php 

Yii::app()->clientScript->registerScript( 'deleteDialog', "

function deleteDialog( url, act )

{

Loading.show();

  var action = '';

  var selectionIds = $.fn.yiiGridView.getSelection('Lead-grid');

  var form = $( '#delete-dialog div.delete-dialog-content form' );

  if( url == false )

  {

    action = '&ids=' + selectionIds + '&action=' + act;

    url = form.attr( 'action' );

  }

  {$updateJS}

}" ); ?>


<?php

$this->beginWidget('zii.widgets.jui.CJuiDialog', array( // the dialog

    'id'=>'dialogviewdetail',

    'options'=>array(

        'title'=>'Lead Detail',

        'autoOpen'=>false,

        'modal'=>true,

        'width'=>'auto',

        'height'=>'auto',

		'resizable'=>true,


    ),

));?>

<div class="divForForm1"></div>

<?php $this->endWidget();?>


<!--code for import Accounts-->

<?php 

$this->beginWidget( 'zii.widgets.jui.CJuiDialog', array(

  'id' => 'importlead-dialog',

  'options' => array(

    'title' => 'Import Accounts',

    'autoOpen' => false,

    'modal' => true,

    'width' => '900',

	'height'=>'500',

    'resizable' => true,

  ),

)); ?>

<div class="importdata"><?php 


	$model=new ImportForm; 

$this->renderpartial('/import/index', array('model'=>$model));?></div>

<?php $this->endWidget(); ?>

<!--end of import Accounts-->


<!--code for export Accounts-->

<?php 

$this->beginWidget( 'zii.widgets.jui.CJuiDialog', array(

  'id' => 'exportlead-dialog',

  'options' => array(

    'title' => 'Export Leads',

    'autoOpen' => false,

    'modal' => true,

    'width' => '900',

	'height'=>'500',

    'resizable' => true,

  ),

)); ?>

<div class="exportdata"><?php 


	$model=new ExportForm; 

$this->renderpartial('/export/index', array('model'=>$model));?></div>

<?php $this->endWidget(); ?>

<!--end of export Accounts-->



clicking on "add leads" will open first popup and renders a _create view and from create _form view.

now i am pasting code of controller that opens first popup

leadcontroller/actioncreate




public function actionCreate()

	{

		$model=new Leads;


		// Uncomment the following line if AJAX validation is needed

		// $this->performAjaxValidation($model);

       

		if(isset($_POST['Leads']))

		{

			$model->attributes=$_POST['Leads'];

			$model->date_enter=time();

			$model->date_modified=time();

			$model->modified_by=Yii::app()->user->id;

			$model->created_by=Yii::app()->user->id;

			

			if($model->save())

            {

                if (Yii::app()->request->isAjaxRequest)

                {

					

					

				 echo CJSON::encode(array(

					'status'=>'success',

					'content'=>"Leads successfully added",

					//'mydata'=>$myval,

				));

					exit;

					

                              

                }

                else

                    $this->redirect(array('view','id'=>$model->lead_id));

            }

		}


		if (Yii::app()->request->isAjaxRequest)

        {

			Yii::app()->clientScript->scriptMap['jquery.js'] = false;

             echo CJSON::encode( array(

			  'status' => 'failure',

			  'div'=>$this->renderPartial('_form',array('model'=>$model),true),

			  'content' => $this->renderPartial( '_form', array(

				'model' => $model ), true, true ),

			));

            exit;               

        }

        else

          $this->render('create',array('model'=>$model));

			

	

	}



now i am pasting a code for _form view from which another popup is opening




<div class="form">


<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(

	'id'=>'leads-form',

	'enableAjaxValidation'=>true,

)); ?>


	<p class="note">Fields with <span class="required">*</span> are required.</p>


	<?php echo $form->errorSummary($model); ?>

    <div >

     <div class="pull-left">

			<?php $box = $this->beginWidget('bootstrap.widgets.TbBox', array(

            'title' => 'Overview',

            'headerIcon' => 'icon-th-list',

            ));?>

                  <div class="pull-left">

                      <table>

                           <tr>

                              <td><?php echo $form->labelEx($model,'first_name'); ?></td>

                              <td><?php echo $form->dropDownList($model,'nametitle', array('Mr.' => 'Mr.','Ms.' => 'Ms.', 'Mrs.' => 'Mrs.', 'Dr.' => 'Dr.', 'Prof.' => 'Prof.'),array('style'=>'width:60px'));?>

									<?php echo $form->textField($model,'first_name',array('style'=>'width:90px')); ?>

                                    <?php echo $form->error($model,'first_name'); ?>

                              </td>

                           </tr>

                           <tr>

                               <td><?php echo $form->labelEx($model,'title'); ?></td>

                               <td> <?php echo $form->textField($model,'title',array('style'=>'width:150px')); ?>

                                    <?php echo $form->error($model,'title'); ?>

                               </td>

                           </tr>

                          

                           <tr>

                               <td><?php echo $form->labelEx($model,'department'); ?></td>

                               <td><?php echo $form->textField($model,'department',array('style'=>'width:150px')); ?>

                                   <?php echo $form->error($model,'department'); ?>

                               </td>

                           </tr>

                          

                           <tr>

                                <td><?php echo $form->labelEx($model,'acc_id'); ?></td>

                           		<td> <?php 

										if(isset($_GET['id']))

										{

										echo $form->textField($model,'acc_id',array('id'=>'memberid','value'=>$model->acc->acc_name,'style'=>'width:150px')); 

										}

										else

										{

										

										?>

										<?php echo $form->textField($model,'acc_id',array('id'=>'memberid','style'=>'width:150px')); } ?>

										<?php echo $form->hiddenField($model,'acc_id'); ?>

										<?php echo $form->error($model,'acc_id'); ?>

										<?php

												 $imageUrl = Yii::app()->request->baseUrl."/images/select.png"; 

												 $image = CHtml::image($imageUrl, "img",array('height'=>14,'width'=>14,'border'=>0)); 

										?>

										<?php echo CHtml::link($image, "",array('style'=>'cursor: pointer; text-decoration: underline;','onclick'=>"{addaccount(); $('#dialogaccount').dialog('open');}"));?>

                                 </td>

                            </tr>

                            

                           

                            

                           <tr>

                               <td><?php echo $form->labelEx($model,'email_address'); ?></td>

                               <td><?php echo $form->textField($model,'email_address',array('style'=>'width:150px')); ?>

                                   <?php echo $form->error($model,'email_address'); ?>

                               </td>

                           </tr>

                          

                      </table>

                  </div>

                   <div class="pull-right">

                   <table>

                       <tr>

								<td><?php echo $form->labelEx($model,'last_name'); ?></td>

                                <td> <?php echo $form->textField($model,'last_name',array('style'=>'width:150px')); ?>

                                    <?php echo $form->error($model,'last_name'); ?>

                                 </td>

                           </tr>

                            <tr>

							   <td><?php echo $form->labelEx($model,'phone_office'); ?></td>

                               <td><?php echo $form->textField($model,'phone_office',array('style'=>'width:150px')); ?>

                                   <?php echo $form->error($model,'phone_office'); ?>

                               </td>

                           </tr>

                            <tr>

                              <td><?php echo $form->labelEx($model,'phone_mobile'); ?></td>

                              <td> <?php echo $form->textField($model,'phone_mobile',array('style'=>'width:150px')); ?>

                                   <?php echo $form->error($model,'phone_mobile'); ?>

                              </td>

                           </tr>

                            <tr>

                                <td><?php echo $form->labelEx($model,'phone_fax'); ?></td>

                                <td><?php echo $form->textField($model,'phone_fax',array('style'=>'width:150px')); ?>

                                    <?php echo $form->error($model,'phone_fax'); ?>

                                </td>

                            </tr>

                             <tr>

                              <td><?php echo $form->labelEx($model,'website'); ?></td>

                              <td><?php echo $form->textField($model,'website',array('style'=>'width:150px')); ?>

                                  <?php echo $form->error($model,'website'); ?>

                              </td>

                          </tr>

                   </table>

                   </div>

                <div style="clear:both"></div>

                

			<?php $this->endWidget();?>

             <?php $box = $this->beginWidget('bootstrap.widgets.TbBox', array(

                            'title' => 'More Information',

                            'headerIcon' => 'icon-th-list',

                     ));?>   

                <div class="pull-left">

                        <table>

                            <tr>

                               <td><?php echo $form->labelEx($model,'status'); ?></td>

                               <td><?php echo $form->dropDownList($model,'status', array('New' => 'New','Assigned' => 'Assigned', 'In Progress' => 'In Progress', 'Converted' => 'Converted', 'Recycled' => 'Recycled','Dead' => 'Dead'),array('prompt'=>'','style'=>'width:150px'));?>

                                <?php echo $form->error($model,'status'); ?>


                                </td>

                            </tr>

                           

                            <tr>

                               <td><?php echo $form->labelEx($model,'status_description'); ?></td>

                               <td><?php echo $form->textArea($model,'status_description',array('row'=>6,'column'=>35,'style'=>'width:150px')); ?>

                                   <?php echo $form->error($model,'status_description'); ?>

                               </td>

                            </tr>

                            

                            

                            <tr>

                                <td><?php echo $form->labelEx($model,'oppertunity_amount'); ?></td>

                                <td><?php echo $form->textField($model,'oppertunity_amount',array('style'=>'width:150px')); ?>

                                    <?php echo $form->error($model,'oppertunity_amount'); ?>

                                </td>

                           </tr>

                            

                            

                            <tr>

                               <td><?php echo $form->labelEx($model,'description'); ?></td>

                               <td> <?php echo $form->textArea($model,'description',array('rows'=>4, 'cols'=>30,'style'=>'width:150px')); ?>

                                    <?php echo $form->error($model,'description'); ?>

                               </td>

                           </tr>

                           <tr>

                                <td><?php echo $form->labelEx($model,'campaignid'); ?></td>

                                <td><?php 

									 if(isset($_GET['id']))

									 {

									 echo $form->textField($model,'campaignid',array('id'=>'campaign','value'=>$model->campaign->name,'style'=>'width:150px')); 

									 }

									 else

									 {

									 ?>

									

								     <?php echo $form->textField($model,'campaignid',array('id'=>'campaign','style'=>'width:150px')); } ?>

                                     <?php echo $form->hiddenField($model,'campaignid'); ?>

                                    <?php echo $form->error($model,'campaignid'); ?>

                                    <?php

									 $imageUrl = Yii::app()->request->baseUrl."/images/select.png"; 

									 $image = CHtml::image($imageUrl, "img",array('height'=>14,'width'=>14,'border'=>0)); 

					            	?>

                                    <?php echo CHtml::link($image, "",array('style'=>'cursor: pointer; text-decoration: underline;','onclick'=>"{addcampaign(); $('#dialogcampaign').dialog('open');}"));?>

                                </td>

                               </tr>

                          

                           </table>

                    </div>

                     <div class="pull-right" style="width:250px;" >

                        <table>

                            <tr>

                                <td><?php echo $form->labelEx($model,'leadsource'); ?></td>

                                <td><?php echo $form->dropDownList($model,'leadsource',array('Cold Call'=>'Cold Call','Existing Customer'=>'Existing Customer','Self Generated'=>'Self Generated','Employee'=>'Employee','Partner'=>'Partner','Public Relation'=>'Public Relation','Direct Mail'=>'Direct Mail','Conference'=>'Conference','Trade Show '=>'Trade Show','Website '=>'Website','Word of mouth'=>'Word of mouth','Email '=>'Email','Campaign '=>'Campaign','Other '=>'Other'),array("prompt"=>"",'style'=>'width:150px')); ?>

                                     <?php echo $form->error($model,'leadsource'); ?>

                                </td>

                            </tr>

                            <tr>

                               <td><?php echo $form->labelEx($model,'leadsource_description'); ?></td>

                               <td><?php echo $form->textArea($model,'leadsource_description',array('row'=>6,'column'=>35,'style'=>'width:150px')); ?>

                                   <?php echo $form->error($model,'leadsource_description'); ?>

                               </td>

                            </tr>

                            <tr>

                               <td><?php echo $form->labelEx($model,'reffered_by'); ?></td>

                               <td><?php echo $form->textField($model,'reffered_by',array('style'=>'width:150px')); ?>

                                   <?php echo $form->error($model,'reffered_by'); ?>

                               </td>

                           </tr>

                            <tr>

                                <td><?php echo $form->labelEx($model,'do_not_call'); ?></td>

                                <td><?php echo $form->checkBox($model,'do_not_call',array('value'=>'yes', 'uncheckValue'=>'no','style'=>'width:150px')); ?>

                                 <?php echo $form->error($model,'do_not_call'); ?>

                                </td>

                            </tr>

                            <tr>

                                  <td> <?php echo $form->labelEx($model,'assign_user_id'); ?></td>

                                  <td>

                               <?php

							   if(isset($_GET['id']))

							   {

							   echo $form->textField($model,'assign_user_id',array('id'=>'userid','value'=>$model->assignUser->username,'style'=>'width:150px'));

							   }

							   else

							   {

							   

							   ?>

                                <?php echo $form->textField($model,'assign_user_id',array('id'=>'userid','style'=>'width:150px')); }?>

                                <?php echo $form->hiddenField($model,'assign_user_id'); ?>

							    <?php echo $form->error($model,'assign_user_id'); ?>

                                   <?php

									 $imageUrl = Yii::app()->request->baseUrl."/images/select.png"; 

									 $image = CHtml::image($imageUrl, "img",array('height'=>14,'width'=>14,'border'=>0)); 

					            	?>

                                <?php echo CHtml::link($image, "",array('style'=>'cursor: pointer; text-decoration: underline;','onclick'=>"{adduser(); $('#dialoguser').dialog('open');}"));?>


                            </td>

                         </tr>

                        </table>

                     </div>

                  <div style="clear:both;"></div>   

                  <?php $this->endWidget(); ?>

              </div>  

              <div class="pull-left" style="padding-left:20px;">  

				<?php $box = $this->beginWidget('bootstrap.widgets.TbBox', array(

                            'title' => 'Primary Address',

                            'headerIcon' => 'icon-th-list',

                     ));?>

					 <div class="pull-left">

                      <table>

                         <tr>

                            <td><?php echo $form->labelEx($model,'primary_address_street'); ?></td>

                            <td><?php echo $form->textField($model,'primary_address_street'); ?>

                                <?php echo $form->error($model,'primary_address_street'); ?>

                            </td>

                         </tr>

                        

                        

                         

                         <tr>

                            <td> <?php echo $form->labelEx($model,'primary_address_state'); ?></td>

                            <td><?php echo $form->textField($model,'primary_address_state'); ?>

                                 <?php echo $form->error($model,'primary_address_state'); ?>

                            </td>

                         </tr>

                        

                         

                         <tr>

                            <td> <?php echo $form->labelEx($model,'primary_address_country'); ?></td>

                            <td> <?php echo $form->textField($model,'primary_address_country'); ?>

                                 <?php echo $form->error($model,'primary_address_country'); ?>

                            </td>

                         </tr>

                          <tr>

                                        <td><?php echo $form->labelEx($model,'primary_address_city'); ?></td>

                                        <td><?php echo $form->textField($model,'primary_address_city'); ?>

                                            <?php echo $form->error($model,'primary_address_city'); ?>

                                        </td>

                                     </tr>

                                      <tr>

                                        <td><?php echo $form->labelEx($model,'primary_address_postalcode'); ?></td>

                                        <td><?php echo $form->textField($model,'primary_address_postalcode'); ?>

                                            <?php echo $form->error($model,'primary_address_postalcode'); ?>

                                        </td>

                                     </tr>

                            </table>

                         </div>

                        

             

            <?php $this->endWidget(); ?>

            <?php $box = $this->beginWidget('bootstrap.widgets.TbBox', array(

                            'title' => 'Other Address',

                            'headerIcon' => 'icon-th-list',

                     ));?>

                      <div class="pull-left">

                     <table>

                     <tr>

                           <td><?php echo $form->labelEx($model,'other_address_street'); ?></td>

                           <td> <?php echo $form->textField($model,'other_address_street'); ?>

                                <?php echo $form->error($model,'other_address_street'); ?>

                           </td>

                        </tr>

                        

                        

                       <tr>

                           <td> <?php echo $form->labelEx($model,'other_address_state'); ?></td>

                           <td> <?php echo $form->textField($model,'other_address_state'); ?>

                                <?php echo $form->error($model,'other_address_state'); ?>

                            </td>

                       </tr>

                       

                       <tr>

                           <td><?php echo $form->labelEx($model,'other_address_country'); ?></td>

                           <td> <?php echo $form->textField($model,'other_address_country'); ?>

                                <?php echo $form->error($model,'other_address_country'); ?>

                           </td>

                      </tr>

	                                   <tr>

                           <td><?php echo $form->labelEx($model,'other_address_city'); ?></td>

                           <td><?php echo $form->textField($model,'other_address_city'); ?>

                               <?php echo $form->error($model,'other_address_city'); ?>

                           </td>

                        </tr>

                        <tr>

                            <td><?php echo $form->labelEx($model,'other_address_postalcode'); ?></td>

                            <td><?php echo $form->textField($model,'other_address_postalcode'); ?>

                                 <?php echo $form->error($model,'other_address_postalcode'); ?>

                            </td>

                       </tr>

               </table>

              </div>

              <div style="clear:both;"></div>       

             <?php $this->endWidget(); ?>               

          </div>

          <div style="clear:both;"></div>

          <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save',array('class'=>'submitbtn1')); ?>

	</div>		

                

                

			

      

	

	

<?php $this->endWidget(); ?>

<script type="text/javascript">

function addaccount()

{

    <?php echo CHtml::ajax(array(

            'url'=>array('/account/accounts/accountlist'),

            'data'=> "js:$(this).serialize()",

            'type'=>'post',

			'update'=>'#dialogaccount div.divForForm1',

	 ))?>;

    return false; 

 

}

function addcampaign()

{

    <?php echo CHtml::ajax(array(

            'url'=>array('/campaign/campaigns/campaignlist'),

            'data'=> "js:$(this).serialize()",

            'type'=>'post',

			'update'=>'#dialogcampaign div.divForForm2',

	 ))?>;

    return false; 

 

}

function adduser()

{

    <?php echo CHtml::ajax(array(

            'url'=>array('/user/admin/userlist'),

            'data'=> "js:$(this).serialize()",

            'type'=>'post',

			'update'=>'#dialoguser div.divForForm3',

	 ))?>;

    return false; 

 

}


</script>

<?php

$this->beginWidget('zii.widgets.jui.CJuiDialog', array( // the dialog

    'id'=>'dialogaccount',

    'options'=>array(

        'title'=>'Select Account',

        'autoOpen'=>false,

        'modal'=>true,

        'width'=>'auto',

        'height'=>'auto',

		'resizable'=>true,


    ),

));?>

<div class="divForForm1"></div>

 

<?php $this->endWidget();?>

<?php

$this->beginWidget('zii.widgets.jui.CJuiDialog', array( // the dialog

    'id'=>'dialogcampaign',

    'options'=>array(

        'title'=>'Select Campaign',

        'autoOpen'=>false,

        'modal'=>true,

        'width'=>'auto',

        'height'=>'auto',

		'resizable'=>true,


    ),

));?>

<div class="divForForm2"></div>

 

<?php $this->endWidget();?>

<?php

$this->beginWidget('zii.widgets.jui.CJuiDialog', array( // the dialog

    'id'=>'dialoguser',

    'options'=>array(

        'title'=>'Select User',

        'autoOpen'=>false,

        'modal'=>true,

        'width'=>'auto',

        'height'=>'auto',

		'resizable'=>true,


    ),

));?>

<div class="divForForm3"></div>

 

<?php $this->endWidget();?>

</div><!-- form -->



there is a field campaingn_id clicking on that it open another popup and creating a problem that i have described… now pasting a coding of controller




 public function actionCampaignlist()

	{

	    Yii::app()->clientScript->scriptMap['*.js'] = false;

		 Yii::app()->clientScript->scriptMap['pager.css'] = true;

		 

	    $model=new Campaigns;

		if(isset($_GET['Campaigns']))

			$model->attributes=$_GET['Campaigns'];

			

		$this->renderpartial('campaignlist',array(

			'model'=>$model),false,true);

	}



and now campaing view




<?php $this->widget( 'ext.EUpdateDialog.EUpdateDialog', array(

  'height' => 'auto',

  'resizable' => true,

  'width' => 'auto', )); ?>

 <?php $pageSize=Yii::app()->user->getState('pageSize',Yii::app()->params['defaultPageSize']);?>

  <?php $this->widget('bootstrap.widgets.TbGridView', array(

					'type'=>'striped bordered condensed',

	'id'=>'campaignlist-grid',

	'dataProvider'=>$model->search(),

	'filter'=>$model,

	'cssFile'=>false,

	'selectableRows'=>'2',

	'pager' => array(

                'nextPageLabel' => 'Next',

                'prevPageLabel' => 'Prev',

                'firstPageLabel' => 'First',

                'lastPageLabel' => 'Last',

                'header' => '',

                'maxButtonCount' => 5,

               

        ),


	 "template" => "{pager}{summary}{items}{pager}", 

	'columns'=>array(

	

		 

		 array(

            'header'    => 'name',

            'class'     => 'getcampaign',

            'attribute' => 'name',  

			

			),

		'campaign_type',

		'status',

		'start_date',

		'end_date',

		/*array(

							'name' => 'start_date',

							'value' => 'date("d.m.Y H:i:s",$data->start_date)',

					),

					array(

							'name' => 'end_date',

							'value' => 'date("d.m.Y H:i:s",$data->end_date)',

					),*/

		

	

	

	),

)); ?>






This is a whole code everything is working fine except the problem i have described. :( please someone help me with this… i am really in need of help

Good news,

i have solved one problem which is “automatically aligning and changes in width and height” .:) but now i have only problem remaining which is

i want to open child popup on top of parent popup using cjuidialog. first time it works fine but second time it opens behind parent pop up… ("parent pop means main pop up from which sub pop up is opening.

i have tried z-index plus stack both option but no luck… let me know what i am doing wrong please