I want a FancyBox like that one in the gii module code generator. I have downloaded the EFancyBox extension and made it run. The first time when i press the开发者_StackOverflow link the fancybox is properly displayed and i close it, but when i try the second time a blank window appears with no content. Here is the code:
<?php echo CHtml::link($url,"#data", array('id'=>'iframe')); ?>
<div style="display:none">
<div id="data"><iframe src="<?php echo $url; ?>"
frameborder=0 width=1024 height=768 scrolling=yes></iframe></div> </div>
<?php $this->widget('application.extensions.fancybox.EFancyBox',
array( 'target'=>'a#iframe', 'config'=>array( 'scrolling' => 'no', 'titleShow' => true, ), ) ); ?>
</div>
I have found the solution:
<?php $this->widget('application.extensions.fancybox.EFancyBox', array( 'target'=>'a#iframe', 'config'=>array( 'scrolling' => 'no', 'titleShow' => true, 'onClosed'=>"js:function(){parent.location.reload(true);}" ), ) ); ?>
It seems ok to me, because when you reload the data you need to tell to the fancybox the new dom elements, when you reload you tell the new elements, its ok like that.
<?php $this->widget('application.extensions.fancybox.EFancyBox', array( 'target'=>'a#iframe', 'config'=>array( 'scrolling' => 'no', 'titleShow' => true, 'onClosed'=>"js:function(){parent.location.reload(true);}" ), ) ); ?>
精彩评论