From 6b23858eea553ae0e33a7c26f35f4fb3204a37de Mon Sep 17 00:00:00 2001 From: "ctrlaltca@gmail.com" <> Date: Sat, 16 Jul 2011 11:14:42 +0000 Subject: fix for #343 (reworked r2915 to be more backcompatible on clientside) --- .../Javascripts/source/prado/controls/tabpanel.js | 40 +++++++++++----------- framework/Web/UI/WebControls/TTabPanel.php | 13 ++++--- 2 files changed, 26 insertions(+), 27 deletions(-) (limited to 'framework/Web') diff --git a/framework/Web/Javascripts/source/prado/controls/tabpanel.js b/framework/Web/Javascripts/source/prado/controls/tabpanel.js index 363b5271..f613a677 100644 --- a/framework/Web/Javascripts/source/prado/controls/tabpanel.js +++ b/framework/Web/Javascripts/source/prado/controls/tabpanel.js @@ -11,54 +11,54 @@ Prado.WebUI.TTabPanel.prototype = onInit : function(options) { this.views = options.Views; + this.viewsvis = options.ViewsVis; this.hiddenField = $(options.ID+'_1'); this.activeCssClass = options.ActiveCssClass; this.normalCssClass = options.NormalCssClass; - var i = 0; - for(var index in options.Views) + var length = options.Views.length; + for(var i = 0; igetClientID(); $options['ActiveCssClass']=$this->getActiveTabCssClass(); $options['NormalCssClass']=$this->getTabCssClass(); - $views=''; + $viewIDs=array(); + $viewVis=array(); foreach($this->getViews() as $view) { - if($views!='') - $views.=', '; - $views.= '"'.$view->getClientID().'":'.($view->getVisible() ? '1': '0' ); + $viewIDs[]=$view->getClientID(); + $viewVis[]=$view->getVisible(); } - - $options['Views']='{'.$views.='}'; - $viewIDs=array(); + $options['Views']='[\''.implode('\',\'',$viewIDs).'\']'; + $options['ViewsVis']='[\''.implode('\',\'',$viewVis).'\']'; return $options; } -- cgit v1.2.3