AjaxSubmit in CJuiDialog result headache

I found it VERY useful. All the explanations were very detailed.

The only thing I had to do was for zii.widgets.jui.CJuiDialog

to put the option at ‘autoOpen’=>true

Or did you have another reason to put it at false ? (for me the Dialog wouldn’ t open if false)

The zii dialog - functionnally speaking - is great. However have you noticed the time it takes to display on the screen :mellow: ?

Watch it here http://farm.discardedteenz.com/test/cjuidialog_ajaxbutton/index.php?r=person

Does the same happen to you all ?

About true don’t remember exactly why but false was working for me.

Yes, i have noticed this slow behavior too. Don’t know why. I will have to create other modal with other senarios and maybe i will find a way to work it around. thanks for your comment anyway :)

Use firebug to track ajax requests.

The number of post grows at every form submit.

First time=> 1 post

Second time=> 2 posts

and so on…

Did you manage to solve this problem… I end up with many records in the database if I call the dialog many times without refreshing the parent view before…

@makro, @silintzir

It is a long time since i was writting at this thread. Did you have htmlOptions id defined by you in the ajaxbutton/links because if not this is the issue.

As i found out a few hours ago, the fix was to add ‘live’=>false in the ajaxButoon html options… there was a live event that was keeping posting to the ajaxAction and caused all the inserts… Thanks Anyway!

I found the solution for this issue.

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

            'id'=>"dmaDialog",


            'options'=>array(


				'closeOnEscape'=>true,


                'title'=>Yii::t("dma",'CREATE DMA'),


                'autoOpen'=>true,


                'modal'=>'true',


                'width'=>'450px',


                'height'=>'auto',


				'resizable' =>false,


            	'close'=>"js:function(e,ui){

/*This will fix multiple ajax submittion problem */

            	    jQuery('body').undelegate('#closeDmaDialog', 'click'); 

/*This will fix multiple ajax submittion problem */

            		jQuery('#dmaDialog').empty();


            	 }",


            ),


            ));