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 \Prado\Web\UI\WebControls\setEditText, \Prado\Web\UI\WebControls\setUpdateText, and \Prado\Web\UI\WebControls\setCancelText.
The buttons in the column can be set to display as hyperlinks, push or image buttons by setting the \Prado\Web\UI\WebControls\setButtonType property.
When an edit button is clicked, the datagrid will generate an \Prado\Web\UI\WebControls\onEditCommand event. When an update/cancel button is clicked, the datagrid will generate an \Prado\Web\UI\WebControls\onUpdateCommand or an \Prado\Web\UI\WebControls\onCancelCommand You can write these event handlers to change the state of specific datagrid item.
The \Prado\Web\UI\WebControls\setCausesValidation and \Prado\Web\UI\WebControls\setValidationGroup 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.
Class hierarchy
- \Prado\Web\UI\WebControls\TEditCommandColumn
- \Prado\Web\UI\WebControls\TDataGridColumn
- \Prado\TApplicationComponent
- \Prado\TComponent
Since: 3.0
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
initializeCell(TTableCell $cell, int $columnIndex, string $itemType) : mixed
Initializes the specified cell to its initial values.
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
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
protected
|
createButton(string $commandName, string $text, bool $causesValidation, string $validationGroup) : mixed
Creates a button and initializes its properties.
The button type is determined by \Prado\Web\UI\WebControls\getButtonType. |
\Prado\TApplicationComponent::FX_CACHE_FILE, \Prado\TComponent::GLOBAL_RAISE_EVENT_LISTENER |