From 69fa043ebb880ce8164691d81be7f24e972d8639 Mon Sep 17 00:00:00 2001 From: xue <> Date: Tue, 6 Feb 2007 18:02:21 +0000 Subject: updated comments about renderer feature. --- framework/Web/UI/WebControls/TBoundColumn.php | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'framework/Web/UI/WebControls/TBoundColumn.php') diff --git a/framework/Web/UI/WebControls/TBoundColumn.php b/framework/Web/UI/WebControls/TBoundColumn.php index 89de53bd..7927d198 100644 --- a/framework/Web/UI/WebControls/TBoundColumn.php +++ b/framework/Web/UI/WebControls/TBoundColumn.php @@ -35,6 +35,12 @@ Prado::using('System.Web.UI.WebControls.TDataGridColumn'); * The second method is possible because the textbox control created within the * datagrid cell is the first child. * + * Since v3.1.0, TBoundColumn has introduced two new properties {@link setItemRenderer ItemRenderer} + * and {@link setEditItemRenderer EditItemRenderer} which can be used to specify + * the layout of the datagrid cells in browsing and editing mode. + * A renderer refers to a control class that is to be instantiated as a control. + * For more details, see {@link TRepeater} and {@link TDataList}. + * * @author Qiang Xue * @version $Id$ * @package System.Web.UI.WebControls @@ -56,6 +62,12 @@ class TBoundColumn extends TDataGridColumn * * If not empty, the class will be used to instantiate as a child control in the item cells of the column. * + * If the class implements {@link IDataRenderer}, the Data property + * will be set as the data associated with the datagrid cell during databinding. + * The data can be either the whole data row or a field of the row if + * {@link getDataField DataField} is not empty. If {@link getDataFormatString DataFormatString} + * is not empty, the data will be formatted first before passing to the renderer. + * * @param string the renderer class name in namespace format. * @since 3.1.0 */ @@ -78,6 +90,12 @@ class TBoundColumn extends TDataGridColumn * * If not empty, the class will be used to instantiate as a child control in the item cell that is in edit mode. * + * If the class implements {@link IDataRenderer}, the Data property + * will be set as the data associated with the datagrid cell during databinding. + * The data can be either the whole data row or a field of the row if + * {@link getDataField DataField} is not empty. If {@link getDataFormatString DataFormatString} + * is not empty, the data will be formatted first before passing to the renderer. + * * @param string the renderer class name in namespace format. * @since 3.1.0 */ @@ -211,10 +229,7 @@ class TBoundColumn extends TDataGridColumn $value=$this->formatDataValue($formatString,$this->getDataFieldValue($data,$field)); else $value=$this->formatDataValue($formatString,$data); - if($sender instanceof IItemDataRenderer) - $sender->setData($data); - else if($sender instanceof IDataRenderer) - $sender->setData($value); + $sender->setData($value); } } -- cgit v1.2.3