diff options
author | xue <> | 2006-07-04 15:35:38 +0000 |
---|---|---|
committer | xue <> | 2006-07-04 15:35:38 +0000 |
commit | 2e473b200186161248b8c0d568c176d16bd2e590 (patch) | |
tree | 07265d517c236b339868a0f1e4b240bb5e788df0 /framework/Web | |
parent | 088225e3348808d28b9dfe6347589a51a5235efe (diff) |
Fixed a bug related with postback and EmptyTemplate.
Diffstat (limited to 'framework/Web')
-rw-r--r-- | framework/Web/UI/WebControls/TDataGrid.php | 18 |
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)
{
|