diff options
author | xue <> | 2006-02-04 23:56:29 +0000 |
---|---|---|
committer | xue <> | 2006-02-04 23:56:29 +0000 |
commit | 139ca38ddcf4998c882cfc98cb932524de210d86 (patch) | |
tree | 99471fff9e2db46d01e5473cfd5c1566c7c1209a /framework/Web/UI/WebControls/TRepeater.php | |
parent | 97d5ad831a6003418562b7f44e9a08e562d88a0c (diff) |
Modified TDataGrid sample to enable updating rating.
Diffstat (limited to 'framework/Web/UI/WebControls/TRepeater.php')
-rw-r--r-- | framework/Web/UI/WebControls/TRepeater.php | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/framework/Web/UI/WebControls/TRepeater.php b/framework/Web/UI/WebControls/TRepeater.php index 65b3106e..716478b8 100644 --- a/framework/Web/UI/WebControls/TRepeater.php +++ b/framework/Web/UI/WebControls/TRepeater.php @@ -374,22 +374,19 @@ class TRepeater extends TDataBoundControl implements INamingContainer $this->reset();
$items=$this->getItems();
$itemIndex=0;
- if($data instanceof Traversable)
+ $hasSeparator=$this->_separatorTemplate!==null;
+ foreach($data as $dataItem)
{
- $hasSeparator=$this->_separatorTemplate!==null;
- foreach($data as $dataItem)
- {
- if($itemIndex===0 && $this->_headerTemplate!==null)
- $this->_header=$this->createItemInternal(-1,'Header',true,null);
- if($hasSeparator && $itemIndex>0)
- $this->createItemInternal($itemIndex-1,'Separator',true,null);
- $itemType=$itemIndex%2==0?'Item':'AlternatingItem';
- $items->add($this->createItemInternal($itemIndex,$itemType,true,$dataItem));
- $itemIndex++;
- }
- if($itemIndex>0 && $this->_footerTemplate!==null)
- $this->_footer=$this->createItemInternal(-1,'Footer',true,null);
+ if($itemIndex===0 && $this->_headerTemplate!==null)
+ $this->_header=$this->createItemInternal(-1,'Header',true,null);
+ if($hasSeparator && $itemIndex>0)
+ $this->createItemInternal($itemIndex-1,'Separator',true,null);
+ $itemType=$itemIndex%2==0?'Item':'AlternatingItem';
+ $items->add($this->createItemInternal($itemIndex,$itemType,true,$dataItem));
+ $itemIndex++;
}
+ if($itemIndex>0 && $this->_footerTemplate!==null)
+ $this->_footer=$this->createItemInternal(-1,'Footer',true,null);
$this->setViewState('ItemCount',$itemIndex,0);
}
|