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 \Prado\Web\UI\WebControls\setText and \Prado\Web\UI\WebControls\setDataTextField properties. If both are present, the latter takes precedence. The \Prado\Web\UI\WebControls\setDataTextField property refers to the name of the field in datasource whose value will be used as the button caption. If \Prado\Web\UI\WebControls\setDataTextFormatString 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 \Prado\Web\UI\WebControls\setButtonType property. The \Prado\Web\UI\WebControls\setCommandName 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.
Class hierarchy
- \Prado\Web\UI\WebControls\TButtonColumn
- \Prado\Web\UI\WebControls\TDataGridColumn
- \Prado\TApplicationComponent
- \Prado\TComponent
Since: 3.0
public
|
dataBindColumn(TWebControl $sender, mixed $param) : mixed
Databinds a cell in the column.
This method is invoked when datagrid performs databinding. It populates the content of the cell with the relevant data from data source. |
public
|
|
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 a command button within the cell. |
public
|
|
public
|
|
public
|
setCommandName(string $value) : mixed
Sets the command name associated with the <b>Command</b> event.
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
\Prado\TApplicationComponent::FX_CACHE_FILE, \Prado\TComponent::GLOBAL_RAISE_EVENT_LISTENER |