diff options
author | xue <> | 2006-09-04 22:00:25 +0000 |
---|---|---|
committer | xue <> | 2006-09-04 22:00:25 +0000 |
commit | f587496dcba7c7030062b5dfdc7612f3ed89dbf9 (patch) | |
tree | 845e2be5bef86f056c1ac25ac285a92cc2ad56c3 /framework/Web/UI | |
parent | 9fe3fc70f1d721790265926fac4dc0f3ad6140bf (diff) |
updated datagrid columns to make use of enumerable list item types.
Diffstat (limited to 'framework/Web/UI')
7 files changed, 21 insertions, 21 deletions
diff --git a/framework/Web/UI/WebControls/TBoundColumn.php b/framework/Web/UI/WebControls/TBoundColumn.php index 26fad32b..437dfbf9 100644 --- a/framework/Web/UI/WebControls/TBoundColumn.php +++ b/framework/Web/UI/WebControls/TBoundColumn.php @@ -106,7 +106,7 @@ class TBoundColumn extends TDataGridColumn parent::initializeCell($cell,$columnIndex,$itemType);
switch($itemType)
{
- case TDataGrid::IT_EDITITEM:
+ case TListItemType::EditItem:
$control=$cell;
if(!$this->getReadOnly())
{
@@ -118,9 +118,9 @@ class TBoundColumn extends TDataGridColumn if(($dataField=$this->getDataField())!=='')
$control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn'));
break;
- case TDataGrid::IT_ITEM:
- case TDataGrid::IT_ALTERNATINGITEM:
- case TDataGrid::IT_SELECTEDITEM:
+ case TListItemType::Item:
+ case TListItemType::AlternatingItem:
+ case TListItemType::SelectedItem:
if($this->getDataField()!=='')
$cell->attachEventHandler('OnDataBinding',array($this,'dataBindColumn'));
break;
diff --git a/framework/Web/UI/WebControls/TButtonColumn.php b/framework/Web/UI/WebControls/TButtonColumn.php index 5f2c228d..dd1bf9b0 100644 --- a/framework/Web/UI/WebControls/TButtonColumn.php +++ b/framework/Web/UI/WebControls/TButtonColumn.php @@ -227,7 +227,7 @@ class TButtonColumn extends TDataGridColumn public function initializeCell($cell,$columnIndex,$itemType)
{
parent::initializeCell($cell,$columnIndex,$itemType);
- if($itemType===TDataGrid::IT_ITEM || $itemType===TDataGrid::IT_ALTERNATINGITEM || $itemType===TDataGrid::IT_SELECTEDITEM || $itemType===TDataGrid::IT_EDITITEM)
+ if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::SelectedItem || $itemType===TListItemType::EditItem)
{
$buttonType=$this->getButtonType();
if($buttonType===TButtonColumnType::LinkButton)
diff --git a/framework/Web/UI/WebControls/TCheckBoxColumn.php b/framework/Web/UI/WebControls/TCheckBoxColumn.php index d7fac8cf..82c209ad 100644 --- a/framework/Web/UI/WebControls/TCheckBoxColumn.php +++ b/framework/Web/UI/WebControls/TCheckBoxColumn.php @@ -89,10 +89,10 @@ class TCheckBoxColumn extends TDataGridColumn public function initializeCell($cell,$columnIndex,$itemType)
{
parent::initializeCell($cell,$columnIndex,$itemType);
- if($itemType===TDataGrid::IT_ITEM || $itemType===TDataGrid::IT_ALTERNATINGITEM || $itemType===TDataGrid::IT_SELECTEDITEM || $itemType===TDataGrid::IT_EDITITEM)
+ if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::SelectedItem || $itemType===TListItemType::EditItem)
{
$checkBox=new TCheckBox;
- if($this->getReadOnly() || $itemType!==TDataGrid::IT_EDITITEM)
+ if($this->getReadOnly() || $itemType!==TListItemType::EditItem)
$checkBox->setEnabled(false);
$cell->setHorizontalAlign('Center');
$cell->getControls()->add($checkBox);
diff --git a/framework/Web/UI/WebControls/TDropDownListColumn.php b/framework/Web/UI/WebControls/TDropDownListColumn.php index bcbd87e4..17686c57 100644 --- a/framework/Web/UI/WebControls/TDropDownListColumn.php +++ b/framework/Web/UI/WebControls/TDropDownListColumn.php @@ -242,7 +242,7 @@ class TDropDownListColumn extends TDataGridColumn }
switch($itemType)
{
- case TDataGrid::IT_EDITITEM:
+ case TListItemType::EditItem:
if(!$this->getReadOnly())
{
$listControl=clone $this->_listControl;
@@ -254,9 +254,9 @@ class TDropDownListColumn extends TDataGridColumn $control=$cell;
$control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn'));
break;
- case TDataGrid::IT_ITEM:
- case TDataGrid::IT_ALTERNATINGITEM:
- case TDataGrid::IT_SELECTEDITEM:
+ case TListItemType::Item:
+ case TListItemType::AlternatingItem:
+ case TListItemType::SelectedItem:
if($this->getDataField()!=='')
$cell->attachEventHandler('OnDataBinding',array($this,'dataBindColumn'));
break;
diff --git a/framework/Web/UI/WebControls/TEditCommandColumn.php b/framework/Web/UI/WebControls/TEditCommandColumn.php index 327e03a2..e78982dc 100644 --- a/framework/Web/UI/WebControls/TEditCommandColumn.php +++ b/framework/Web/UI/WebControls/TEditCommandColumn.php @@ -209,13 +209,13 @@ class TEditCommandColumn extends TDataGridColumn public function initializeCell($cell,$columnIndex,$itemType)
{
parent::initializeCell($cell,$columnIndex,$itemType);
- if($itemType===TDataGrid::IT_ITEM || $itemType===TDataGrid::IT_ALTERNATINGITEM || $itemType===TDataGrid::IT_SELECTEDITEM)
+ if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::SelectedItem)
{
$button=$this->createButton('Edit',$this->getEditText(),false,'');
$cell->getControls()->add($button);
$cell->registerObject('EditButton',$button);
}
- else if($itemType===TDataGrid::IT_EDITITEM)
+ else if($itemType===TListItemType::EditItem)
{
$controls=$cell->getControls();
$button=$this->createButton('Update',$this->getUpdateText(),$this->getCausesValidation(),$this->getValidationGroup());
diff --git a/framework/Web/UI/WebControls/THyperLinkColumn.php b/framework/Web/UI/WebControls/THyperLinkColumn.php index b8dbb607..7cca42d5 100644 --- a/framework/Web/UI/WebControls/THyperLinkColumn.php +++ b/framework/Web/UI/WebControls/THyperLinkColumn.php @@ -177,7 +177,7 @@ class THyperLinkColumn extends TDataGridColumn public function initializeCell($cell,$columnIndex,$itemType)
{
parent::initializeCell($cell,$columnIndex,$itemType);
- if($itemType===TDataGrid::IT_ITEM || $itemType===TDataGrid::IT_ALTERNATINGITEM || $itemType===TDataGrid::IT_SELECTEDITEM || $itemType===TDataGrid::IT_EDITITEM)
+ if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::SelectedItem || $itemType===TListItemType::EditItem)
{
$link=new THyperLink;
$link->setText($this->getText());
diff --git a/framework/Web/UI/WebControls/TTemplateColumn.php b/framework/Web/UI/WebControls/TTemplateColumn.php index f83e3290..1f33aa2d 100644 --- a/framework/Web/UI/WebControls/TTemplateColumn.php +++ b/framework/Web/UI/WebControls/TTemplateColumn.php @@ -138,18 +138,18 @@ class TTemplateColumn extends TDataGridColumn $template=null;
switch($itemType)
{
- case TDataGrid::IT_HEADER:
+ case TListItemType::Header:
$template=$this->_headerTemplate;
break;
- case TDataGrid::IT_FOOTER:
+ case TListItemType::Footer:
$template=$this->_footerTemplate;
break;
- case TDataGrid::IT_ITEM:
- case TDataGrid::IT_ALTERNATINGITEM:
- case TDataGrid::IT_SELECTEDITEM:
+ case TListItemType::Item:
+ case TListItemType::AlternatingItem:
+ case TListItemType::SelectedItem:
$template=$this->_itemTemplate;
break;
- case TDataGrid::IT_EDITITEM:
+ case TListItemType::EditItem:
$template=$this->_editItemTemplate===null?$this->_itemTemplate:$this->_editItemTemplate;
break;
}
@@ -159,7 +159,7 @@ class TTemplateColumn extends TDataGridColumn $cell->getControls()->clear();
$template->instantiateIn($cell);
}
- else if($itemType===TDataGrid::IT_ITEM || $itemType===TDataGrid::IT_ALTERNATINGITEM || $itemType===TDataGrid::IT_SELECTEDITEM || $itemType===TDataGrid::IT_EDITITEM)
+ else if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::SelectedItem || $itemType===TListItemType::EditItem)
$cell->setText(' ');
}
}
|