How to redirect on 'close' of CJuiDialog to another view ?

How to redirect on ‘close’ of CJuiDialog to another view ?

My CJuiDialog header is like this …





<?php                

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

        'id'=>'loginDialog',

                        'options'=>array(

                            'title'=>'Add More Details',

                            'autoOpen'=>true,  // set to auto open for testing only

                            'draggable'=>true,

                            'resizable'=>true,

                            'closeOnEscape' => true,                                                       

                            'show'=>'fade',

                            'hide'=>'fade',

                            'position'=>'center',

                            'modal'=>true,

			    'width'=>'700px',

                            'height'=>'auto',

			    'close'=>'site/index',

                        )                       

        

        )

        

);


?>






i want to redirect if somebody closes the popup window without saving ,How i write ‘close’=>’’ ???

Check out the documentation: http://jqueryui.com/demos/dialog/

There is a callback called dialogclose.

This code is completely untested:


<?php                

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

        'id'=>'loginDialog',

                        'options'=>array(

                            'title'=>'Add More Details',

                            'autoOpen'=>true,  // set to auto open for testing only

                            'draggable'=>true,

                            'resizable'=>true,

                            'closeOnEscape' => true,                                                       

                            'show'=>'fade',

                            'hide'=>'fade',

                            'position'=>'center',

                            'modal'=>true,

                            'width'=>'700px',

                            'height'=>'auto',

                            'dialogclose'=>'function() { location.href = url.to.redirect }',

                        )                       

        

        )

        

);


?>



Thank u very much… But How i redirect to site/index ? can u pls explain

anybody can explain how to use dialogclose clearly?


'dialogclose'=>'function() { location.href = url.to.redirect }',

didn’t worked…

Thanks.

VaL

i’ve read this post.

it’s works for me…




'options'=>array(

	        'title'=>'Informasi Karyawan',

	        'autoOpen'=>true,

			'modal'=>true,  

			'width'=>600,

			'open'=> 'js:function(event, ui) { $(".ui-dialog-titlebar-close").click(function() 

								{ location.href = "'.Yii::app()->createUrl("/admin/index").'"; }); }',

	    ),



hope it’s help…

This one worked for me:


'close' => 'js:function(event, ui) { location.href = "/url" }'

thanx eazyval :) it also worked for me… Thanx.