From be5e456c4eb6094bc459cd44af88cb0442f85ec0 Mon Sep 17 00:00:00 2001 From: xue <> Date: Tue, 4 Sep 2007 18:03:23 +0000 Subject: fixed #664. --- framework/Web/UI/WebControls/TDataGrid.php | 48 ++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'framework/Web') diff --git a/framework/Web/UI/WebControls/TDataGrid.php b/framework/Web/UI/WebControls/TDataGrid.php index 411b3778..547c769d 100644 --- a/framework/Web/UI/WebControls/TDataGrid.php +++ b/framework/Web/UI/WebControls/TDataGrid.php @@ -388,6 +388,48 @@ class TDataGrid extends TBaseDataList implements INamingContainer return $style; } + /** + * @return TStyle the style for thead element, if any + * @since 3.1.1 + */ + public function getTableHeadStyle() + { + if(($style=$this->getViewState('TableHeadStyle',null))===null) + { + $style=new TStyle; + $this->setViewState('TableHeadStyle',$style,null); + } + return $style; + } + + /** + * @return TStyle the style for tbody element, if any + * @since 3.1.1 + */ + public function getTableBodyStyle() + { + if(($style=$this->getViewState('TableBodyStyle',null))===null) + { + $style=new TStyle; + $this->setViewState('TableBodyStyle',$style,null); + } + return $style; + } + + /** + * @return TStyle the style for tfoot element, if any + * @since 3.1.1 + */ + public function getTableFootStyle() + { + if(($style=$this->getViewState('TableFootStyle',null))===null) + { + $style=new TStyle; + $this->setViewState('TableFootStyle',$style,null); + } + return $style; + } + /** * @return string caption for the datagrid */ @@ -1482,11 +1524,15 @@ class TDataGrid extends TBaseDataList implements INamingContainer if($this->_header && $this->_header->getVisible()) { $writer->writeLine(); + if($style=$this->getViewState('TableHeadStyle',null)) + $style->addAttributesToRender($writer); $writer->renderBeginTag('thead'); $this->_header->render($writer); $writer->renderEndTag(); } $writer->writeLine(); + if($style=$this->getViewState('TableBodyStyle',null)) + $style->addAttributesToRender($writer); $writer->renderBeginTag('tbody'); foreach($this->getItems() as $item) $item->renderControl($writer); @@ -1495,6 +1541,8 @@ class TDataGrid extends TBaseDataList implements INamingContainer if($this->_footer && $this->_footer->getVisible()) { $writer->writeLine(); + if($style=$this->getViewState('TableFootStyle',null)) + $style->addAttributesToRender($writer); $writer->renderBeginTag('tfoot'); $this->_footer->render($writer); $writer->renderEndTag(); -- cgit v1.2.3