diff options
author | xue <> | 2006-02-06 17:01:15 +0000 |
---|---|---|
committer | xue <> | 2006-02-06 17:01:15 +0000 |
commit | 0cba2b20bb89e2be8728edb25e6a68a764d35c19 (patch) | |
tree | 261335bfb9ba9726b0bfe82316f9cd17372a984e /framework/Web | |
parent | 750ab8b5a8814295a4774612cc4f9c727d316fe3 (diff) |
Fixed a bug in TDataGrid about columnspan of pager cell.
Diffstat (limited to 'framework/Web')
-rw-r--r-- | framework/Web/UI/WebControls/TDataGrid.php | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/framework/Web/UI/WebControls/TDataGrid.php b/framework/Web/UI/WebControls/TDataGrid.php index b8151d97..16dc7644 100644 --- a/framework/Web/UI/WebControls/TDataGrid.php +++ b/framework/Web/UI/WebControls/TDataGrid.php @@ -113,7 +113,6 @@ class TDataGrid extends TBaseDataList implements INamingContainer private $_items=null;
private $_header=null;
private $_footer=null;
- private $_pager=null;
private $_pagedDataSource=null;
/**
@@ -289,14 +288,6 @@ class TDataGrid extends TBaseDataList implements INamingContainer }
/**
- * @return TDataGridItem the pager
- */
- public function getPager()
- {
- return $this->_pager;
- }
-
- /**
* @return TDataGridItem the selected item, null if no item is selected.
*/
public function getSelectedItem()
@@ -831,7 +822,7 @@ class TDataGrid extends TBaseDataList implements INamingContainer $column->initialize();
if($allowPaging)
$this->createPager(-1,-1,$columnCount,$ds);
- $this->createItemInternal(-1,-1,'Header',false,null,$columns);
+ $this->_header=$this->createItemInternal(-1,-1,'Header',false,null,$columns);
$selectedIndex=$this->getSelectedItemIndex();
$editIndex=$this->getEditItemIndex();
$index=0;
@@ -850,7 +841,7 @@ class TDataGrid extends TBaseDataList implements INamingContainer $index++;
$dsIndex++;
}
- $this->createItemInternal(-1,-1,'Footer',false,null,$columns);
+ $this->_footer=$this->createItemInternal(-1,-1,'Footer',false,null,$columns);
if($allowPaging)
$this->createPager(-1,-1,$columnCount,$ds);
}
@@ -893,7 +884,7 @@ class TDataGrid extends TBaseDataList implements INamingContainer $allowPaging=$ds->getAllowPaging();
if($allowPaging)
$this->createPager(-1,-1,$columnCount,$ds);
- $this->createItemInternal(-1,-1,'Header',true,null,$columns);
+ $this->_header=$this->createItemInternal(-1,-1,'Header',true,null,$columns);
$selectedIndex=$this->getSelectedItemIndex();
$editIndex=$this->getEditItemIndex();
$index=0;
@@ -914,7 +905,7 @@ class TDataGrid extends TBaseDataList implements INamingContainer $index++;
$dsIndex++;
}
- $this->createItemInternal(-1,-1,'Footer',true,null,$columns);
+ $this->_footer=$this->createItemInternal(-1,-1,'Footer',true,null,$columns);
if($allowPaging)
$this->createPager(-1,-1,$columnCount,$ds);
$this->setViewState('ItemCount',$index,0);
@@ -1073,7 +1064,7 @@ class TDataGrid extends TBaseDataList implements INamingContainer if($startPageIndex>1)
{
$button=new TLinkButton;
- $button->setText('...');
+ $button->setText($style->getPrevPageText());
$button->setCommandName('page');
$button->setCommandParameter($startPageIndex-1);
$button->setCausesValidation(false);
@@ -1106,7 +1097,7 @@ class TDataGrid extends TBaseDataList implements INamingContainer {
$controls->add(' ');
$button=new TLinkButton;
- $button->setText('...');
+ $button->setText($style->getNextPageText());
$button->setCommandName('page');
$button->setCommandParameter($endPageIndex+1);
$button->setCausesValidation(false);
@@ -1177,6 +1168,14 @@ class TDataGrid extends TBaseDataList implements INamingContainer $pagerStyle=$this->getViewState('PagerStyle',null);
$separatorStyle=$this->getViewState('SeparatorStyle',null);
+ $invisibleColumns=0;
+ if($this->_columns)
+ {
+ foreach($this->_columns as $column)
+ if(!$column->getVisible())
+ $invisibleColumns++;
+ }
+
foreach($this->getControls() as $index=>$item)
{
$itemType=$item->getItemType();
@@ -1276,6 +1275,11 @@ class TDataGrid extends TBaseDataList implements INamingContainer }
}
}
+ else if($itemType==='Pager' && $invisibleColumns>0)
+ {
+ $cell=$item->getCells()->itemAt(0);
+ $cell->setColumnSpan($cell->getColumnSpan()-$invisibleColumns);
+ }
}
}
|