PHP Class Prado\Web\UI\WebControls\TEditCommandColumn

TEditCommandColumn contains the Edit command buttons for editing data items in each row. TEditCommandColumn will create an edit button if a cell is not in edit mode. Otherwise an update button and a cancel button will be created within the cell. The button captions are specified using {@link setEditText EditText}, {@link setUpdateText UpdateText}, and {@link setCancelText CancelText}. The buttons in the column can be set to display as hyperlinks, push or image buttons by setting the {@link setButtonType ButtonType} property. When an edit button is clicked, the datagrid will generate an {@link onEditCommand OnEditCommand} event. When an update/cancel button is clicked, the datagrid will generate an {@link onUpdateCommand OnUpdateCommand} or an {@link onCancelCommand OnCancelCommand} You can write these event handlers to change the state of specific datagrid item. The {@link setCausesValidation CausesValidation} and {@link setValidationGroup ValidationGroup} properties affect the corresponding properties of the edit and update buttons. The cancel button does not cause validation by default. The command buttons in the column can be accessed by one of the following methods: $datagridItem->ButtonColumnID->EditButton (or UpdateButton, CancelButton) $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

Public Methods

Method Description
getButtonType ( ) : TButtonColumnType
getCancelImageUrl ( ) : string
getCancelText ( ) : string
getCausesValidation ( ) : boolean
getEditImageUrl ( ) : string
getEditText ( ) : string
getUpdateImageUrl ( ) : string
getUpdateText ( ) : string
getValidationGroup ( ) : string
initializeCell ( $cell, $columnIndex, $itemType ) Initializes the specified cell to its initial values.
setButtonType ( $value )
setCancelImageUrl ( $value )
setCancelText ( $value )
setCausesValidation ( $value )
setEditImageUrl ( $value )
setEditText ( $value )
setUpdateImageUrl ( $value )
setUpdateText ( $value )
setValidationGroup ( $value )

Protected Methods

Method Description
createButton ( $commandName, $text, $causesValidation, $validationGroup ) : mixed Creates a button and initializes its properties.

Method Details

createButton() protected method

The button type is determined by {@link getButtonType ButtonType}.
protected createButton ( $commandName, $text, $causesValidation, $validationGroup ) : mixed
return mixed the newly created button.

getButtonType() public method

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

getCancelImageUrl() public method

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

getCancelText() public method

public getCancelText ( ) : string
return string the caption of the cancel button. Defaults to 'Cancel'.

getCausesValidation() public method

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

getEditImageUrl() public method

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

getEditText() public method

public getEditText ( ) : string
return string the caption of the edit button. Defaults to 'Edit'.

getUpdateImageUrl() public method

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

getUpdateText() public method

public getUpdateText ( ) : string
return string the caption of the update button. Defaults to 'Update'.

getValidationGroup() public method

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

initializeCell() public method

This method overrides the parent implementation. It creates an update and a cancel button for cell in edit mode. Otherwise it creates an edit button.
public initializeCell ( $cell, $columnIndex, $itemType )

setButtonType() public method

public setButtonType ( $value )

setCancelImageUrl() public method

public setCancelImageUrl ( $value )

setCancelText() public method

public setCancelText ( $value )

setCausesValidation() public method

public setCausesValidation ( $value )

setEditImageUrl() public method

public setEditImageUrl ( $value )

setEditText() public method

public setEditText ( $value )

setUpdateImageUrl() public method

public setUpdateImageUrl ( $value )

setUpdateText() public method

public setUpdateText ( $value )

setValidationGroup() public method

public setValidationGroup ( $value )