Is there a way to hide an empty jQuery tab?
Specifically I am using Yii’s CJuiTabs and pulling the tab content from a db.
If that content does not exist in the db I do not want a tab displayed at all for that. Can this be done?
Including CJuiTabs in Yii:
$this->widget('zii.widgets.jui.CJuiTabs', array(
'tabs'=>array(
'StaticTab 1'=>'Content for tab 1',
'StaticTab 2'=>array('content'=>'Content for tab 2', 'id'=>'tab2'),
// panel 3 contains the content rendered by a partial view
'AjaxTab'=>array('ajax'=>$ajaxUrl),
),
// additional javascript options for the tabs plugin
'options'=>array(
'collapsible'=>true,
),
));
For the stuff generated in PHP
PS: Written on my mobile, Code could be a bit more sophisticated 🙂