PHP Класс Prado\Web\UI\WebControls\TDropDownListColumn

TDropDownListColumn 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 setDataTextField DataTextField}. You can customize the display by setting {@link setDataTextFormatString DataTextFormatString}. If {@link setReadOnly ReadOnly} is false, TDropDownListColumn will display cells in edit mode with dropdown lists. Otherwise, a static text is displayed. The currently selected dropndown list item is specified by the data indexed with {@link setDataValueField DataValueField}. There are two approaches to specify the list items available for selection. The first approach uses template syntax as follows, The second approach specifies a data source to be bound to the dropdown lists by setting {@link setListDataSource ListDataSource}. Like generic list controls, you may also want to specify which data fields are used for item values and texts by setting {@link setListValueField ListValueField} and {@link setListTextField ListTextField}, respectively. Furthermore, the item texts may be formatted by using {@link setListTextFormatString ListTextFormatString}. Note, if you specify {@link setListDataSource ListDataSource}, do it before calling the datagrid's dataBind(). The dropdown list control in the TDropDownListColumn can be accessed by one of the following two methods: $datagridItem->DropDownListColumnID->DropDownList $datagridItem->DropDownListColumnID->Controls[0] The second method is possible because the dropdown list control created within the datagrid cell is the first child.
С версии: 3.0.4
Автор: Qiang Xue ([email protected])
Наследование: extends TDataGridColumn
Показать файл Открыть проект

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

Метод Описание
__construct ( )
addParsedObject ( $object ) Adds object parsed from template to the control.
dataBindColumn ( $sender, $param ) Databinds a cell in the column.
getDataTextField ( ) : string
getDataTextFormatString ( ) : string
getDataValueField ( ) : string
getListDataSource ( ) : Traversable
getListTextField ( ) : string
getListTextFormatString ( ) : string
getListValueField ( ) : string
getReadOnly ( ) : boolean
initializeCell ( $cell, $columnIndex, $itemType ) Initializes the specified cell to its initial values.
loadState ( $state ) Loads items from viewstate.
saveState ( ) Saves items into viewstate.
setDataTextField ( $value ) Sets the field of the data source that provides the text content of the column.
setDataTextFormatString ( $value )
setDataValueField ( $value ) Sets the field of the data source that provides the key selecting an item in dropdown list.
setListDataSource ( $value )
setListTextField ( $value )
setListTextFormatString ( $value )
setListValueField ( $value )
setReadOnly ( $value )

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

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

public __construct ( )

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

This method adds only {@link TListItem} objects into the {@link getItems Items} collection. All other objects are ignored.
public addParsedObject ( $object )

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 )

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

public getDataTextField ( ) : string
Результат string the field of the data source that provides the text content of the column.

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

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

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

public getDataValueField ( ) : string
Результат string the field of the data source that provides the key selecting an item in dropdown list.

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

public getListDataSource ( ) : Traversable
Результат Traversable data source to be bound to the dropdown list boxes.

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

public getListTextField ( ) : string
Результат string the data field used to populate the texts of the dropdown list items. Defaults to empty.

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

public getListTextFormatString ( ) : string
Результат string the formatting string used to control how the list item texts will be displayed.

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

public getListValueField ( ) : string
Результат string the data field used to populate the values of the dropdown list items. Defaults to empty.

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 )

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

This method overrides the parent implementation by loading list items
public loadState ( $state )

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

This method overrides the parent implementation by saving list items
public saveState ( )

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

If this is not set, the data specified via {@link getDataValueField DataValueField} will be displayed in the column.
public setDataTextField ( $value )

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

public setDataTextFormatString ( $value )

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

If this is not present, the data specified via {@link getDataTextField DataTextField} (without applying the formatting string) will be used for selection, instead.
public setDataValueField ( $value )

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

public setListDataSource ( $value )

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

public setListTextField ( $value )

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

public setListTextFormatString ( $value )

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

public setListValueField ( $value )

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

public setReadOnly ( $value )