Class \Prado\Web\UI\WebControls\TBoundColumn
TBoundColumn represents a column that is bound to a field in a data source. The cells in the column will be displayed using the data indexed by \Prado\Web\UI\WebControls\setDataField. You can customize the display by setting \Prado\Web\UI\WebControls\setDataFormatString.
If \Prado\Web\UI\WebControls\setReadOnly is false, TBoundColumn will display cells in edit mode with textboxes. Otherwise, a static text is displayed.
When a datagrid row is in edit mode, the textbox control in the TBoundColumn can be accessed by one of the following two methods:
$datagridItem->BoundColumnID->TextBox
$datagridItem->BoundColumnID->Controls[0]
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 \Prado\Web\UI\WebControls\setItemRenderer and \Prado\Web\UI\WebControls\setEditItemRenderer 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.
Class hierarchy
- \Prado\Web\UI\WebControls\TBoundColumn
- \Prado\Web\UI\WebControls\TDataGridColumn
- \Prado\TApplicationComponent
- \Prado\TComponent
Since: 3.0
public
|
dataBindColumn(mixed $sender, mixed $param) : mixed
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. |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
initializeCell(TTableCell $cell, int $columnIndex, string $itemType) : mixed
Initializes the specified cell to its initial values.
This method overrides the parent implementation. It creates a textbox for item in edit mode and the column is not read-only. Otherwise it displays a static text. The caption of the button and the static text are retrieved from the datasource. |
public
|
|
public
|
|
public
|
setEditItemRenderer(string $value) : mixed
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 data associated with the datagrid cell during databinding. The data can be either the whole data row or a field of the row if \Prado\Web\UI\WebControls\getDataField is not empty. If \Prado\Web\UI\WebControls\getDataFormatString is not empty, the data will be formatted first before passing to the renderer. |
public
|
setItemRenderer(string $value) : mixed
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 data associated with the datagrid cell during databinding. The data can be either the whole data row or a field of the row if \Prado\Web\UI\WebControls\getDataField is not empty. If \Prado\Web\UI\WebControls\getDataFormatString is not empty, the data will be formatted first before passing to the renderer. |
public
|
\Prado\TApplicationComponent::FX_CACHE_FILE, \Prado\TComponent::GLOBAL_RAISE_EVENT_LISTENER |