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

TButtonColumn contains a user-defined command button, such as Add or Remove, that corresponds with each row in the column. The caption of the buttons in the column is determined by {@link setText Text} and {@link setDataTextField DataTextField} properties. If both are present, the latter takes precedence. The {@link setDataTextField DataTextField} property refers to the name of the field in datasource whose value will be used as the button caption. If {@link setDataTextFormatString DataTextFormatString} is not empty, the value will be formatted before rendering. The buttons in the column can be set to display as hyperlinks, push buttons or images by setting the {@link setButtonType ButtonType} property. The {@link setCommandName CommandName} will assign its value to all button's CommandName property. The datagrid will capture the command event where you can write event handlers based on different command names. The buttons' CausesValidation and ValidationGroup property values are determined by the column's corresponding properties. The buttons in the column can be accessed by one of the following two methods: $datagridItem->ButtonColumnID->Button $datagridItem->ButtonColumnID->Controls[0] The second method is possible because the button control created within the datagrid cell is the first child.
С версии: 3.0
Автор: Qiang Xue ([email protected])
Наследование: extends TDataGridColumn
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
dataBindColumn ( $sender, $param ) Databinds a cell in the column.
getButtonType ( ) : TButtonColumnType
getCausesValidation ( ) : boolean
getCommandName ( ) : string
getDataImageUrlField ( ) : string
getDataImageUrlFormatString ( ) : string
getDataTextField ( ) : string
getDataTextFormatString ( ) : string
getImageUrl ( ) : string
getText ( ) : string
getValidationGroup ( ) : string
initializeCell ( $cell, $columnIndex, $itemType ) Initializes the specified cell to its initial values.
setButtonType ( $value )
setCausesValidation ( $value )
setCommandName ( $value ) Sets the command name associated with the Command event.
setDataImageUrlField ( $value )
setDataImageUrlFormatString ( $value )
setDataTextField ( $value )
setDataTextFormatString ( $value )
setImageUrl ( $value )
setText ( $value ) Sets the text caption of the button.
setValidationGroup ( $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 )

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

public getButtonType ( ) : TButtonColumnType
Результат TButtonColumnType the type of command button. Defaults to TButtonColumnType::LinkButton.

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

public getCausesValidation ( ) : boolean
Результат boolean whether postback event trigger by this button will cause input validation, default is true

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

public getCommandName ( ) : string
Результат string the command name associated with the OnCommand event.

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

public getDataImageUrlField ( ) : string
Результат string the field name from the data source to bind to the button image url

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

public getDataImageUrlFormatString ( ) : string
Результат string the formatting string used to control how the button image url will be displayed.

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

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

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

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

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

public getImageUrl ( ) : string
Результат string the URL of the image file for image buttons

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

public getText ( ) : string
Результат string the text caption of the button

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

public getValidationGroup ( ) : string
Результат string the group of validators which the button causes validation upon postback

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

This method overrides the parent implementation. It creates a command button within the cell.
public initializeCell ( $cell, $columnIndex, $itemType )

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

public setButtonType ( $value )

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

public setCausesValidation ( $value )

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

Sets the command name associated with the Command event.
public setCommandName ( $value )

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

public setDataImageUrlField ( $value )

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

public setDataImageUrlFormatString ( $value )

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

public setDataTextField ( $value )

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

public setDataTextFormatString ( $value )

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

public setImageUrl ( $value )

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

Sets the text caption of the button.
public setText ( $value )

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

public setValidationGroup ( $value )