summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TDataList.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI/WebControls/TDataList.php')
-rw-r--r--framework/Web/UI/WebControls/TDataList.php30
1 files changed, 20 insertions, 10 deletions
diff --git a/framework/Web/UI/WebControls/TDataList.php b/framework/Web/UI/WebControls/TDataList.php
index 0ac0664d..ab1e8085 100644
--- a/framework/Web/UI/WebControls/TDataList.php
+++ b/framework/Web/UI/WebControls/TDataList.php
@@ -904,15 +904,25 @@ class TDataList extends TBaseDataList implements INamingContainer, IRepeatInfoUs
{
$itemStyle=$this->getViewState('ItemStyle',null);
- $alternatingItemStyle=new TTableItemStyle($itemStyle);
- if(($style=$this->getViewState('AlternatingItemStyle',null))!==null)
- $alternatingItemStyle->mergeWith($style);
+ $alternatingItemStyle=$this->getViewState('AlternatingItemStyle',null);
+ if($itemStyle!==null)
+ {
+ if($alternatingItemStyle===null)
+ $alternatingItemStyle=$itemStyle;
+ else
+ $alternatingItemStyle->mergeWith($itemStyle);
+ }
$selectedItemStyle=$this->getViewState('SelectedItemStyle',null);
- $editItemStyle=new TTableItemStyle($selectedItemStyle);
- if(($style=$this->getViewState('EditItemStyle',null))!==null)
- $editItemStyle->copyFrom($style);
+ $editItemStyle=$this->getViewState('EditItemStyle',null);
+ if($selectedItemStyle!==null)
+ {
+ if($editItemStyle===null)
+ $editItemStyle=$selectedItemStyle;
+ else
+ $editItemStyle->mergeWith($selectedItemStyle);
+ }
$headerStyle=$this->getViewState('HeaderStyle',null);
$footerStyle=$this->getViewState('FooterStyle',null);
@@ -944,6 +954,8 @@ class TDataList extends TBaseDataList implements INamingContainer, IRepeatInfoUs
$item->getStyle()->mergeWith($alternatingItemStyle);
break;
case 'SelectedItem':
+ if($selectedItemStyle)
+ $item->getStyle()->mergeWith($selectedItemStyle);
if($index % 2==1)
{
if($itemStyle)
@@ -954,10 +966,10 @@ class TDataList extends TBaseDataList implements INamingContainer, IRepeatInfoUs
if($alternatingItemStyle)
$item->getStyle()->mergeWith($alternatingItemStyle);
}
- if($selectedItemStyle)
- $item->getStyle()->mergeWith($selectedItemStyle);
break;
case 'EditItem':
+ if($editItemStyle)
+ $item->getStyle()->mergeWith($editItemStyle);
if($index % 2==1)
{
if($itemStyle)
@@ -968,8 +980,6 @@ class TDataList extends TBaseDataList implements INamingContainer, IRepeatInfoUs
if($alternatingItemStyle)
$item->getStyle()->mergeWith($alternatingItemStyle);
}
- if($editItemStyle)
- $item->getStyle()->mergeWith($editItemStyle);
break;
default:
break;