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
Datei anzeigen Open project: pradosoft/prado Class Usage Examples

Public Methods

Method 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 method

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 method

public getButtonType ( ) : TButtonColumnType
return TButtonColumnType the type of command button. Defaults to TButtonColumnType::LinkButton.

getCausesValidation() public method

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

getCommandName() public method

public getCommandName ( ) : string
return string the command name associated with the OnCommand event.

getDataImageUrlField() public method

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

getDataImageUrlFormatString() public method

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

getDataTextField() public method

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

getDataTextFormatString() public method

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

getImageUrl() public method

public getImageUrl ( ) : string
return string the URL of the image file for image buttons

getText() public method

public getText ( ) : string
return string the text caption of the button

getValidationGroup() public method

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

initializeCell() public method

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

setButtonType() public method

public setButtonType ( $value )

setCausesValidation() public method

public setCausesValidation ( $value )

setCommandName() public method

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

setDataImageUrlField() public method

public setDataImageUrlField ( $value )

setDataImageUrlFormatString() public method

public setDataImageUrlFormatString ( $value )

setDataTextField() public method

public setDataTextField ( $value )

setDataTextFormatString() public method

public setDataTextFormatString ( $value )

setImageUrl() public method

public setImageUrl ( $value )

setText() public method

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

setValidationGroup() public method

public setValidationGroup ( $value )