summaryrefslogtreecommitdiff
path: root/framework/Web
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web')
-rw-r--r--framework/Web/UI/WebControls/TDataGrid.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/framework/Web/UI/WebControls/TDataGrid.php b/framework/Web/UI/WebControls/TDataGrid.php
index 1a81974e..f7697fec 100644
--- a/framework/Web/UI/WebControls/TDataGrid.php
+++ b/framework/Web/UI/WebControls/TDataGrid.php
@@ -900,13 +900,16 @@ class TDataGrid extends TBaseDataList implements INamingContainer
{
foreach($columns as $column)
$column->initialize();
- if($allowPaging)
- $this->_topPager=$this->createPager();
- $this->_header=$this->createItemInternal(-1,-1,self::IT_HEADER,false,null,$columns);
$selectedIndex=$this->getSelectedItemIndex();
$editIndex=$this->getEditItemIndex();
for($index=0;$index<$itemCount;++$index)
{
+ if($index===0)
+ {
+ if($allowPaging)
+ $this->_topPager=$this->createPager();
+ $this->_header=$this->createItemInternal(-1,-1,self::IT_HEADER,false,null,$columns);
+ }
if($index===$editIndex)
$itemType=self::IT_EDITITEM;
else if($index===$selectedIndex)
@@ -918,9 +921,12 @@ class TDataGrid extends TBaseDataList implements INamingContainer
$items->add($this->createItemInternal($index,$dsIndex,$itemType,false,null,$columns));
$dsIndex++;
}
- $this->_footer=$this->createItemInternal(-1,-1,self::IT_FOOTER,false,null,$columns);
- if($allowPaging)
- $this->_bottomPager=$this->createPager();
+ if($index>0)
+ {
+ $this->_footer=$this->createItemInternal(-1,-1,self::IT_FOOTER,false,null,$columns);
+ if($allowPaging)
+ $this->_bottomPager=$this->createPager();
+ }
}
if(!$dsIndex && $this->_emptyTemplate!==null)
{