PHP Class 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.
Since: 3.0
Author: Qiang Xue ([email protected])
Inheritance: extends TDataGridColumn
Afficher le fichier Open project: pradosoft/prado Class Usage Examples

Méthodes publiques

Méthode Description
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 )

Method Details

dataBindColumn() public méthode

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 méthode

public getButtonType ( ) : TButtonColumnType
Résultat TButtonColumnType the type of command button. Defaults to TButtonColumnType::LinkButton.

getCausesValidation() public méthode

public getCausesValidation ( ) : boolean
Résultat boolean whether postback event trigger by this button will cause input validation, default is true

getCommandName() public méthode

public getCommandName ( ) : string
Résultat string the command name associated with the OnCommand event.

getDataImageUrlField() public méthode

public getDataImageUrlField ( ) : string
Résultat string the field name from the data source to bind to the button image url

getDataImageUrlFormatString() public méthode

public getDataImageUrlFormatString ( ) : string
Résultat string the formatting string used to control how the button image url will be displayed.

getDataTextField() public méthode

public getDataTextField ( ) : string
Résultat string the field name from the data source to bind to the button caption

getDataTextFormatString() public méthode

public getDataTextFormatString ( ) : string
Résultat string the formatting string used to control how the button caption will be displayed.

getImageUrl() public méthode

public getImageUrl ( ) : string
Résultat string the URL of the image file for image buttons

getText() public méthode

public getText ( ) : string
Résultat string the text caption of the button

getValidationGroup() public méthode

public getValidationGroup ( ) : string
Résultat string the group of validators which the button causes validation upon postback

initializeCell() public méthode

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

setButtonType() public méthode

public setButtonType ( $value )

setCausesValidation() public méthode

public setCausesValidation ( $value )

setCommandName() public méthode

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

setDataImageUrlField() public méthode

public setDataImageUrlField ( $value )

setDataImageUrlFormatString() public méthode

public setDataImageUrlFormatString ( $value )

setDataTextField() public méthode

public setDataTextField ( $value )

setDataTextFormatString() public méthode

public setDataTextFormatString ( $value )

setImageUrl() public méthode

public setImageUrl ( $value )

setText() public méthode

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

setValidationGroup() public méthode

public setValidationGroup ( $value )