Advertisement
christiansalazarh

optimizando el CJuiTabs (jqueryUI tabs)

Dec 21st, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.11 KB | None | 0 0
  1. <?php
  2. // hay casos en que las vistas muy voluminosas causan que el HTML sin formato se vea
  3. // primero que el efecto de jQueryUi.tabs(). Solución: haremos el tab visible solo cuando
  4. // todo el html haya sido cargado, usando script jQuery posicionado con:
  5. // CClientScript::POS_LOAD.
  6. //
  7. // por: Christian Salazar,  christiansalazarh@gmail.com
  8. //
  9. $this->widget('zii.widgets.jui.CJuiTabs',array(
  10.     'id'=>'article_tab',
  11.     'htmlOptions'=>array('style'=>'display: none;'),  // INVISIBLE..
  12.     'tabs'=>array(
  13.         'Datos del Articulo'=>$this->renderPartial('_form',
  14.             array('model'=>$model),true),
  15.         'Imagenes'=>$this->renderPartial('_form-images',
  16.             array('model'=>$model),true),
  17.         'Opciones'=>$this->renderPartial('_form-options',
  18.             array('model'=>$model),true),
  19.         'Stock'=>$this->renderPartial('_form-stock',
  20.             array('model'=>$model),true),
  21.     ),
  22.     'options'=>array(
  23.         'collapsible'=>false,
  24.         'cookie'=>9000,
  25.     ),
  26. ));
  27.  
  28. // VISIBLE solo cuando cargue todo..
  29. Yii::app()->getClientScript()->registerScript("articletab", // un ID unico tambien
  30. "$('#article_tab').show();" ,CClientScript::POS_LOAD);      // el ID del tab
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement