CJuiDIalog and CGridView with ajaxLink

in my merides/create view i have this ajaxLink and an empty <div>

<?php echo CHtml::ajaxLink('Find', $this->createUrl('/person/persongrid',



array('id'=>'senderDialog')); ?> 

<div id="dialog_ground" ></div>

which calls this action.

        public function actionPersongrid() {                                                                                                                 

                $model=new Person('search');                                                                                                                 

                if( isset($_GET['inputField']) ){                                                                                                            



                if(isset($_GET['Person'])) {                                                                                                                 

                        $attributes = $_GET['Person'];                                                                                                       

                        if( isset( $attributes['myf'] ) ) {                                                                                                  

                            $myf = PersonMyf::model()->findByAttributes(array('myf'=>$attributes['myf']));                                                   

                            if( !empty($myf) )                                                                                                               

                                $attributes['myf'] = $myf->id;                                                                                               


                        $model->attributes=$attributes; }                                                                                                    






Where the persongridview it is called is this.

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


    // additional javascript options for the dialog plugin


        'title'=>'Person dialog',






      $dp = $model->search();


      $this->widget('zii.widgets.grid.CGridView', array(





























<div class="row button" align="right">

<?php echo CHtml::ajaxButton('Select','',

        array('success'=>'js:function() {

            var p_sel = $.fn.yiiGridView.getSelection("person-grid");

            if ( p_sel != "") {








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

The issue i am facing is this…Image

Check where is the pointer…The return of the CJuiDialog are not in the div as i set to update but outside of it…this will have conflicts when i will try to get a CJuiDialog for a second time …etc

tydeas_dr, this is a problem I faced too and I guess many yii developers too.

Summarizing the question is:



create conflicts with all clientScript that are OUTSIDE the div to update and the call of


doesn’t render the clientScript INSIDE the div.

I have no solution for this problem.

In my opinion, the framework should provide the possibility of create an own ClientScriptManager for collect the client script of the div to change with ajax.

This ClientScriptManager should be rendered inside the div so that will no modify the "main" client script.

I have no idea of how to do (and if is possible).

Should i repo this to code.google.com repo?

Well, I am not 100% sure that is a mistake.

Maybe you can open a thread in bug report explainig what is our problem. If is a mistake the staff will advice us to create a ticket.

Moved topic to bug reports. Can’t say anything about the issue itself.

Google code repository issue report for this.

Take a look at this post