## Class TEditCommandColumn

Description

TEditCommandColumn class

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 EditText, UpdateText, and CancelText.

The buttons in the column can be set to display as hyperlinks or push buttons by setting the ButtonType property.

When an edit button is clicked, the datagrid will generate an onEditCommand event. When an update/cancel button is clicked, the datagrid will generate an onUpdateCommand or an onCancelCommand You can write these event handlers to change the state of specific datagrid item.

The CausesValidation and ValidationGroup properties affect the corresponding properties of the edit and update buttons. The cancel button does not cause validation by default.

- since: 3.0
- version: $Revision: $ $Date: $
- author: Qiang Xue <qiang.xue@gmail.com>

Located in /Web/UI/WebControls/TEditCommandColumn.php (line 46)

    TComponent
       |
       --TApplicationComponent
          |
          --TDataGridColumn
             |
             --TEditCommandColumn

Method Summary
mixed createButton (string $commandName, string $text, boolean $causesValidation, string $validationGroup)
string getButtonType ()
string getCancelText ()
boolean getCausesValidation ()
string getEditText ()
string getUpdateText ()
string getValidationGroup ()
void initializeCell (TTableCell $cell, integer $columnIndex, string $itemType)
void setButtonType (string $value)
void setCancelText (string $value)
void setCausesValidation (boolean $value)
void setEditText (string $value)
void setUpdateText (string $value)
void setValidationGroup (string $value)
Methods
createButton (line 176)

Creates a button and initializes its properties.

The button type is determined by ButtonType.

- return: the newly created button.
- access: protected

mixed createButton (string $commandName, string $text, boolean $causesValidation, string $validationGroup)

- string $commandName: command name associated with the button
- string $text: button caption
- boolean $causesValidation: whether the button should cause validation
- string $validationGroup: the validation group that the button belongs to

getButtonType (line 51)

- return: the type of command button. Defaults to LinkButton.
- access: public

string getButtonType ()
getCancelText (line 99)

- return: the caption of the cancel button. Defaults to 'Cancel'.
- access: public

string getCancelText ()
getCausesValidation (line 115)

- return: whether postback event trigger by edit or update button will cause input validation, default is true
- access: public

boolean getCausesValidation ()
getEditText (line 67)

- return: the caption of the edit button. Defaults to 'Edit'.
- access: public

string getEditText ()
getUpdateText (line 83)

- return: the caption of the update button. Defaults to 'Update'.
- access: public

string getUpdateText ()
getValidationGroup (line 131)

- return: the group of validators which the edit or update button causes validation upon postback
- access: public

string getValidationGroup ()
initializeCell (line 153)

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.

- access: public

void initializeCell (TTableCell $cell, integer $columnIndex, string $itemType)

- TTableCell $cell: the cell to be initialized.
- integer $columnIndex: the index to the Columns property that the cell resides in.
- string $itemType: the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem)

Redefinition of:

TDataGridColumn::initializeCell()
  Initializes the specified cell to its initial values.

setButtonType (line 59)

- access: public

void setButtonType (string $value)

- string $value: the type of command button, LinkButton or PushButton

setCancelText (line 107)

- access: public

void setCancelText (string $value)

- string $value: the caption of the cancel button

setCausesValidation (line 123)

- access: public

void setCausesValidation (boolean $value)

- boolean $value: whether postback event trigger by edit or update button will cause input validation

setEditText (line 75)

- access: public

void setEditText (string $value)

- string $value: the caption of the edit button

setUpdateText (line 91)

- access: public

void setUpdateText (string $value)

- string $value: the caption of the update button

setValidationGroup (line 139)

- access: public

void setValidationGroup (string $value)

- string $value: the group of validators which the edit or update button causes validation upon postback

#### Inherited Methods

Inherited From TDataGridColumn

> TDataGridColumn::formatDataValue()
> TDataGridColumn::getDataFieldValue()
> TDataGridColumn::getFooterStyle()
> TDataGridColumn::getFooterText()
> TDataGridColumn::getHeaderImageUrl()
> TDataGridColumn::getHeaderStyle()
> TDataGridColumn::getHeaderText()
> TDataGridColumn::getItemStyle()
> TDataGridColumn::getOwner()
> TDataGridColumn::getSortExpression()
> TDataGridColumn::getViewState()
> TDataGridColumn::getVisible()
> TDataGridColumn::initialize()
> TDataGridColumn::initializeCell()
> TDataGridColumn::loadState()
> TDataGridColumn::saveState()
> TDataGridColumn::setFooterText()
> TDataGridColumn::setHeaderImageUrl()
> TDataGridColumn::setHeaderText()
> TDataGridColumn::setOwner()
> TDataGridColumn::setSortExpression()
> TDataGridColumn::setViewState()
> TDataGridColumn::setVisible()

Inherited From TApplicationComponent

> TApplicationComponent::getApplication()
> TApplicationComponent::getRequest()
> TApplicationComponent::getResponse()
> TApplicationComponent::getService()
> TApplicationComponent::getSession()
> TApplicationComponent::getUser()
> TApplicationComponent::publishAsset()
> TApplicationComponent::publishFilePath()

Inherited From TComponent

> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::detachEventHandler()
> TComponent::evaluateExpression()
> TComponent::evaluateStatements()
> TComponent::getEventHandlers()
> TComponent::getSubProperty()
> TComponent::hasEvent()
> TComponent::hasEventHandler()
> TComponent::hasProperty()
> TComponent::raiseEvent()
> TComponent::setSubProperty()
> TComponent::__get()
> TComponent::__set()

Documentation generated on Mon, 01 May 2006 23:03:26 -0400 by phpDocumentor 1.3.0RC4