## Class TTemplateColumn

Description

TTemplateColumn class

TTemplateColumn customizes the layout of controls in the column with templates. In particular, you can specify ItemTemplate, EditItemTemplate, HeaderTemplate and FooterTemplate to customize specific type of cells in the column.

Since v3.1.0, TTemplateColumn has introduced two new properties ItemRenderer and 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 TRepeater and TDataList.

When a renderer and a template are both defined for a type of item, the former takes precedence.

- since: 3.0
- version: $Id: TTemplateColumn.php 2541 2008-10-21 15:05:13Z qiang.xue $
- author: Qiang Xue <qiang.xue@gmail.com>

Located in /Web/UI/WebControls/TTemplateColumn.php (line 41)

    TComponent
       |
       --TApplicationComponent
          |
          --TDataGridColumn
             |
             --TTemplateColumn

Method Summary
void dataBindColumn (mixed $sender, mixed $param)
string getEditItemRenderer ()
ITemplate getEditItemTemplate ()
ITemplate getFooterTemplate ()
ITemplate getHeaderTemplate ()
string getItemRenderer ()
ITemplate getItemTemplate ()
void initializeCell (TTableCell $cell, integer $columnIndex, string $itemType)
void setEditItemRenderer (string $value)
void setEditItemTemplate (ITemplate $value)
void setFooterTemplate (ITemplate $value)
void setHeaderTemplate (ITemplate $value)
void setItemRenderer (string $value)
void setItemTemplate (ITemplate $value)
Methods
dataBindColumn (line 250)

Databinds a cell in the column.

This method is invoked when datagrid performs databinding. It populates the content of the cell with the relevant data from data source.

- access: public

void dataBindColumn (mixed $sender, mixed $param)
getEditItemRenderer (line 81)

- return: the class name for the edit item cell renderer. Defaults to empty, meaning not set.
- access: public
- since: 3.1.0

string getEditItemRenderer ()
getEditItemTemplate (line 105)

- return: the edit item template
- access: public

ITemplate getEditItemTemplate ()
getFooterTemplate (line 165)

- return: the footer template
- access: public

ITemplate getFooterTemplate ()
getHeaderTemplate (line 145)

- return: the header template
- access: public

ITemplate getHeaderTemplate ()
getItemRenderer (line 56)

- return: the class name for the item cell renderer. Defaults to empty, meaning not set.
- access: public
- since: 3.1.0

string getItemRenderer ()
getItemTemplate (line 125)

- return: the item template
- access: public

ITemplate getItemTemplate ()
initializeCell (line 191)

Initializes the specified cell to its initial values.

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

- access: public

void initializeCell (TTableCell $cell, integer $columnIndex, string $itemType)

- TTableCell $cell: the cell to be initialized.
- integer $columnIndex: the index to the Columns property that the cell resides in.
- string $itemType: the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem)

Redefinition of:

TDataGridColumn::initializeCell()
  Initializes the specified cell to its initial values.

setEditItemRenderer (line 97)

Sets the edit item cell renderer class.

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 IDataRenderer, the Data property will be set as the row of the data associated with the datagrid item that this cell resides in.

- access: public
- since: 3.1.0

void setEditItemRenderer (string $value)

- string $value: the renderer class name in namespace format.

setEditItemTemplate (line 114)

- access: public
- throws: TInvalidDataTypeException if the input is not an ITemplate or not null.

void setEditItemTemplate (ITemplate $value)

- ITemplate $value: the edit item template

setFooterTemplate (line 174)

- access: public
- throws: TInvalidDataTypeException if the input is not an ITemplate or not null.

void setFooterTemplate (ITemplate $value)

- ITemplate $value: the footer template

setHeaderTemplate (line 154)

- access: public
- throws: TInvalidDataTypeException if the input is not an ITemplate or not null.

void setHeaderTemplate (ITemplate $value)

- ITemplate $value: the header template.

setItemRenderer (line 72)

Sets the item cell renderer class.

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 IDataRenderer, the Data property will be set as the row of the data associated with the datagrid item that this cell resides in.

- access: public
- since: 3.1.0

void setItemRenderer (string $value)

- string $value: the renderer class name in namespace format.

setItemTemplate (line 134)

- access: public
- throws: TInvalidDataTypeException if the input is not an ITemplate or not null.

void setItemTemplate (ITemplate $value)

- ITemplate $value: the item template

#### Inherited Methods

Inherited From TDataGridColumn

> TDataGridColumn::formatDataValue()
> TDataGridColumn::getAllowSorting()
> TDataGridColumn::getDataFieldValue()
> TDataGridColumn::getEnableCellGrouping()
> TDataGridColumn::getFooterRenderer()
> TDataGridColumn::getFooterStyle()
> TDataGridColumn::getFooterText()
> TDataGridColumn::getHeaderImageUrl()
> TDataGridColumn::getHeaderRenderer()
> TDataGridColumn::getHeaderStyle()
> TDataGridColumn::getHeaderText()
> TDataGridColumn::getID()
> TDataGridColumn::getItemStyle()
> TDataGridColumn::getOwner()
> TDataGridColumn::getSortExpression()
> TDataGridColumn::getViewState()
> TDataGridColumn::getVisible()
> TDataGridColumn::initialize()
> TDataGridColumn::initializeCell()
> TDataGridColumn::initializeFooterCell()
> TDataGridColumn::initializeHeaderCell()
> TDataGridColumn::loadState()
> TDataGridColumn::saveState()
> TDataGridColumn::setEnableCellGrouping()
> TDataGridColumn::setFooterRenderer()
> TDataGridColumn::setFooterText()
> TDataGridColumn::setHeaderImageUrl()
> TDataGridColumn::setHeaderRenderer()
> TDataGridColumn::setHeaderText()
> TDataGridColumn::setID()
> TDataGridColumn::setOwner()
> TDataGridColumn::setSortExpression()
> TDataGridColumn::setViewState()
> TDataGridColumn::setVisible()

Inherited From TApplicationComponent

> TApplicationComponent::getApplication()
> TApplicationComponent::getRequest()
> TApplicationComponent::getResponse()
> TApplicationComponent::getService()
> TApplicationComponent::getSession()
> TApplicationComponent::getUser()
> TApplicationComponent::publishAsset()
> TApplicationComponent::publishFilePath()

Inherited From TComponent

> TComponent::addParsedObject()
> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::createdOnTemplate()
> TComponent::detachEventHandler()
> TComponent::evaluateExpression()
> TComponent::evaluateStatements()
> TComponent::getEventHandlers()
> TComponent::getSubProperty()
> TComponent::hasEvent()
> TComponent::hasEventHandler()
> TComponent::hasProperty()
> TComponent::raiseEvent()
> TComponent::setSubProperty()
> TComponent::__get()
> TComponent::__set()

Documentation generated on Sun, 11 Jan 2009 20:24:08 -0500 by phpDocumentor 1.3.0RC4