PHP Класс 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 {@link setDataField DataField}. You can customize the display by setting {@link setDataFormatString DataFormatString}. If {@link setReadOnly ReadOnly} 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 {@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}.
С версии: 3.0
Автор: Qiang Xue ([email protected])
Наследование: extends TDataGridColumn
Показать файл Открыть проект

Открытые методы

Метод Описание
dataBindColumn ( $sender, $param ) Databinds a cell in the column.
getDataField ( ) : string
getDataFormatString ( ) : string
getEditItemRenderer ( ) : string
getItemRenderer ( ) : string
getReadOnly ( ) : boolean
initializeCell ( $cell, $columnIndex, $itemType ) Initializes the specified cell to its initial values.
setDataField ( $value )
setDataFormatString ( $value )
setEditItemRenderer ( $value ) Sets the edit item cell renderer class.
setItemRenderer ( $value ) Sets the item cell renderer class.
setReadOnly ( $value )

Описание методов

dataBindColumn() публичный Метод

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 )

getDataField() публичный Метод

public getDataField ( ) : string
Результат string the field name from the data source to bind to the column

getDataFormatString() публичный Метод

public getDataFormatString ( ) : string
Результат string the formatting string used to control how the bound data will be displayed.

getEditItemRenderer() публичный Метод

С версии: 3.1.0
public getEditItemRenderer ( ) : string
Результат string the class name for the edit item cell renderer. Defaults to empty, meaning not set.

getItemRenderer() публичный Метод

С версии: 3.1.0
public getItemRenderer ( ) : string
Результат string the class name for the item cell renderer. Defaults to empty, meaning not set.

getReadOnly() публичный Метод

public getReadOnly ( ) : boolean
Результат boolean whether the items in the column can be edited. Defaults to false.

initializeCell() публичный Метод

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 initializeCell ( $cell, $columnIndex, $itemType )

setDataField() публичный Метод

public setDataField ( $value )

setDataFormatString() публичный Метод

public setDataFormatString ( $value )

setEditItemRenderer() публичный Метод

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 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.
С версии: 3.1.0
public setEditItemRenderer ( $value )

setItemRenderer() публичный Метод

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 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.
С версии: 3.1.0
public setItemRenderer ( $value )

setReadOnly() публичный Метод

public setReadOnly ( $value )