summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TDataGrid.php
diff options
context:
space:
mode:
authorxue <>2007-09-04 18:03:23 +0000
committerxue <>2007-09-04 18:03:23 +0000
commitbe5e456c4eb6094bc459cd44af88cb0442f85ec0 (patch)
treec53f5cb1c2faea1880483ba84ab27791f2af449a /framework/Web/UI/WebControls/TDataGrid.php
parent9d204d586526120bfa3fc217043edc1d69c11295 (diff)
fixed #664.
Diffstat (limited to 'framework/Web/UI/WebControls/TDataGrid.php')
-rw-r--r--framework/Web/UI/WebControls/TDataGrid.php48
1 files changed, 48 insertions, 0 deletions
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
@@ -389,6 +389,48 @@ class TDataGrid extends TBaseDataList implements INamingContainer
}
/**
+ * @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
*/
public function getCaption()
@@ -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();