summaryrefslogtreecommitdiff
path: root/framework/Web/UI
diff options
context:
space:
mode:
authorxue <>2006-11-27 03:28:24 +0000
committerxue <>2006-11-27 03:28:24 +0000
commit7bf5efc28c3bd0675778ddedc5ad6c6c5e2abc18 (patch)
treea41143d86dacdf4f53f9a5c9b20434105583f729 /framework/Web/UI
parentbe7e81cbe08c5df97e9f1614318ce0168935f1b1 (diff)
merge from 3.0 branch till 1521.
Diffstat (limited to 'framework/Web/UI')
-rw-r--r--framework/Web/UI/WebControls/TDataGrid.php6
-rw-r--r--framework/Web/UI/WebControls/TPager.php20
2 files changed, 18 insertions, 8 deletions
diff --git a/framework/Web/UI/WebControls/TDataGrid.php b/framework/Web/UI/WebControls/TDataGrid.php
index ccbd8be3..90042b12 100644
--- a/framework/Web/UI/WebControls/TDataGrid.php
+++ b/framework/Web/UI/WebControls/TDataGrid.php
@@ -276,11 +276,7 @@ class TDataGrid extends TBaseDataList implements INamingContainer
*/
protected function createStyle()
{
- $style=new TTableStyle;
- $style->setGridLines('Both');
- $style->setCellSpacing(0);
- $style->setBorderCollapse(true);
- return $style;
+ return new TTableStyle;
}
/**
diff --git a/framework/Web/UI/WebControls/TPager.php b/framework/Web/UI/WebControls/TPager.php
index e3aee892..df096125 100644
--- a/framework/Web/UI/WebControls/TPager.php
+++ b/framework/Web/UI/WebControls/TPager.php
@@ -51,6 +51,8 @@ class TPager extends TWebControl implements INamingContainer
const CMD_PAGE_FIRST='First';
const CMD_PAGE_LAST='Last';
+ private $_pageCount=0;
+
/**
* Restores the pager state.
* This method overrides the parent implementation and is invoked when
@@ -268,16 +270,28 @@ class TPager extends TWebControl implements INamingContainer
if(($targetControl=$this->getNamingContainer()->findControl($controlID))===null || !($targetControl instanceof TDataBoundControl))
throw new TConfigurationException('pager_controltopaginate_invalid',$controlID);
- if($targetControl->getAllowPaging() && $targetControl->getPageCount()>1)
+ if($targetControl->getAllowPaging())
{
- $this->setVisible(true);
+ $this->_pageCount=$targetControl->getPageCount();
$this->getControls()->clear();
$this->setPageCount($targetControl->getPageCount());
$this->setCurrentPageIndex($targetControl->getCurrentPageIndex());
$this->buildPager();
}
else
- $this->setVisible(false);
+ $this->_pageCount=0;
+ }
+
+ /**
+ * Renders the control.
+ * The method overrides the parent implementation by rendering
+ * the pager only when there are two or more pages.
+ * @param THtmlWriter the writer
+ */
+ public function render($writer)
+ {
+ if($this->_pageCount>1)
+ parent::render($writer);
}
/**