开发者

FancyBox like in gii module

开发者 https://www.devze.com 2023-04-13 06:03 出处:网络
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 pr

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);}" ), ) ); ?>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号