PHP Class Prado\Web\UI\WebControls\TTemplateColumn

TTemplateColumn customizes the layout of controls in the column with templates. In particular, you can specify {@link setItemTemplate ItemTemplate}, {@link setEditItemTemplate EditItemTemplate}, {@link setHeaderTemplate HeaderTemplate} and {@link setFooterTemplate FooterTemplate} to customize specific type of cells in the column. Since v3.1.0, TTemplateColumn 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}. When a renderer and a template are both defined for a type of item, the former takes precedence.
Since: 3.0
Author: Qiang Xue ([email protected])
Inheritance: extends TDataGridColumn
Exibir arquivo Open project: pradosoft/prado

Public Methods

Method Description
dataBindColumn ( $sender, $param ) Databinds a cell in the column.
getEditItemRenderer ( ) : string
getEditItemTemplate ( ) : Prado\Web\UI\ITemplate
getFooterTemplate ( ) : Prado\Web\UI\ITemplate
getHeaderTemplate ( ) : Prado\Web\UI\ITemplate
getItemRenderer ( ) : string
getItemTemplate ( ) : Prado\Web\UI\ITemplate
initializeCell ( $cell, $columnIndex, $itemType ) Initializes the specified cell to its initial values.
setEditItemRenderer ( $value ) Sets the edit item cell renderer class.
setEditItemTemplate ( $value )
setFooterTemplate ( $value )
setHeaderTemplate ( $value )
setItemRenderer ( $value ) Sets the item cell renderer class.
setItemTemplate ( $value )

Method Details

dataBindColumn() public method

This method is invoked when datagrid performs databinding. It populates the content of the cell with the relevant data from data source.
public dataBindColumn ( $sender, $param )

getEditItemRenderer() public method

Since: 3.1.0
public getEditItemRenderer ( ) : string
return string the class name for the edit item cell renderer. Defaults to empty, meaning not set.

getEditItemTemplate() public method

public getEditItemTemplate ( ) : Prado\Web\UI\ITemplate
return Prado\Web\UI\ITemplate the edit item template

getFooterTemplate() public method

public getFooterTemplate ( ) : Prado\Web\UI\ITemplate
return Prado\Web\UI\ITemplate the footer template

getHeaderTemplate() public method

public getHeaderTemplate ( ) : Prado\Web\UI\ITemplate
return Prado\Web\UI\ITemplate the header template

getItemRenderer() public method

Since: 3.1.0
public getItemRenderer ( ) : string
return string the class name for the item cell renderer. Defaults to empty, meaning not set.

getItemTemplate() public method

public getItemTemplate ( ) : Prado\Web\UI\ITemplate
return Prado\Web\UI\ITemplate the item template

initializeCell() public method

This method overrides the parent implementation. It initializes the cell based on different templates (ItemTemplate, EditItemTemplate, HeaderTemplate, FooterTemplate).
public initializeCell ( $cell, $columnIndex, $itemType )

setEditItemRenderer() public method

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 \Prado\IDataRenderer}, the Data property will be set as the row of the data associated with the datagrid item that this cell resides in.
Since: 3.1.0
public setEditItemRenderer ( $value )

setEditItemTemplate() public method

public setEditItemTemplate ( $value )

setFooterTemplate() public method

public setFooterTemplate ( $value )

setHeaderTemplate() public method

public setHeaderTemplate ( $value )

setItemRenderer() public method

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 \Prado\IDataRenderer}, the Data property will be set as the row of the data associated with the datagrid item that this cell resides in.
Since: 3.1.0
public setItemRenderer ( $value )

setItemTemplate() public method

public setItemTemplate ( $value )