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, push or image 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.

The command buttons in the column can be accessed by one of the following methods:

  1. $datagridItem->ButtonColumnID->EditButton (or UpdateButton, CancelButton)
  2. $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
  • version: $Id: TEditCommandColumn.php 1673 2007-02-05 21:55:51Z xue $
  • author: Qiang Xue <qiang.xue@gmail.com>

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

TComponent
   |
   --TApplicationComponent
      |
      --TDataGridColumn
         |
         --TEditCommandColumn
Method Summary
mixed createButton (string $commandName, string $text, boolean $causesValidation, string $validationGroup)
string getCancelImageUrl ()
string getCancelText ()
boolean getCausesValidation ()
string getEditImageUrl ()
string getEditText ()
string getUpdateImageUrl ()
string getUpdateText ()
string getValidationGroup ()
void initializeCell (TTableCell $cell, integer $columnIndex, string $itemType)
void setCancelImageUrl (string $value)
void setCancelText (string $value)
void setCausesValidation (boolean $value)
void setEditImageUrl (string $value)
void setEditText (string $value)
void setUpdateImageUrl (string $value)
void setUpdateText (string $value)
void setValidationGroup (string $value)
Methods
createButton (line 241)

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 59)
  • return: the type of command button. Defaults to TButtonColumnType::LinkButton.
  • access: public
TButtonColumnType getButtonType ()
getCancelImageUrl (line 155)
  • return: the URL of the image file for cancel image buttons
  • access: public
string getCancelImageUrl ()
getCancelText (line 139)
  • return: the caption of the cancel button. Defaults to 'Cancel'.
  • access: public
string getCancelText ()
getCausesValidation (line 171)
  • return: whether postback event trigger by edit or update button will cause input validation, default is true
  • access: public
boolean getCausesValidation ()
getEditImageUrl (line 91)
  • return: the URL of the image file for edit image buttons
  • access: public
string getEditImageUrl ()
getEditText (line 75)
  • return: the caption of the edit button. Defaults to 'Edit'.
  • access: public
string getEditText ()
getUpdateImageUrl (line 123)
  • return: the URL of the image file for update image buttons
  • access: public
string getUpdateImageUrl ()
getUpdateText (line 107)
  • return: the caption of the update button. Defaults to 'Update'.
  • access: public
string getUpdateText ()
getValidationGroup (line 187)
  • return: the group of validators which the edit or update button causes validation upon postback
  • access: public
string getValidationGroup ()
initializeCell (line 209)

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 67)
  • access: public
void setButtonType (TButtonColumnType $value)
setCancelImageUrl (line 163)
  • access: public
void setCancelImageUrl (string $value)
  • string $value: the URL of the image file for cancel image buttons
setCancelText (line 147)
  • access: public
void setCancelText (string $value)
  • string $value: the caption of the cancel button
setCausesValidation (line 179)
  • access: public
void setCausesValidation (boolean $value)
  • boolean $value: whether postback event trigger by edit or update button will cause input validation
setEditImageUrl (line 99)
  • access: public
void setEditImageUrl (string $value)
  • string $value: the URL of the image file for edit image buttons
setEditText (line 83)
  • access: public
void setEditText (string $value)
  • string $value: the caption of the edit button
setUpdateImageUrl (line 131)
  • access: public
void setUpdateImageUrl (string $value)
  • string $value: the URL of the image file for update image buttons
setUpdateText (line 115)
  • access: public
void setUpdateText (string $value)
  • string $value: the caption of the update button
setValidationGroup (line 195)
  • 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::getAllowSorting()
TDataGridColumn::getDataFieldValue()
TDataGridColumn::getEnableCellGrouping()
TDataGridColumn::getFooterRenderer()
TDataGridColumn::getFooterStyle()
TDataGridColumn::getFooterText()
TDataGridColumn::getHeaderImageUrl()
TDataGridColumn::getHeaderRenderer()
TDataGridColumn::getHeaderStyle()
TDataGridColumn::getHeaderText()
TDataGridColumn::getID()
TDataGridColumn::getItemStyle()
TDataGridColumn::getOwner()
TDataGridColumn::getSortExpression()
TDataGridColumn::getViewState()
TDataGridColumn::getVisible()
TDataGridColumn::initialize()
TDataGridColumn::initializeCell()
TDataGridColumn::initializeFooterCell()
TDataGridColumn::initializeHeaderCell()
TDataGridColumn::loadState()
TDataGridColumn::saveState()
TDataGridColumn::setEnableCellGrouping()
TDataGridColumn::setFooterRenderer()
TDataGridColumn::setFooterText()
TDataGridColumn::setHeaderImageUrl()
TDataGridColumn::setHeaderRenderer()
TDataGridColumn::setHeaderText()
TDataGridColumn::setID()
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::addParsedObject()
TComponent::attachEventHandler()
TComponent::canGetProperty()
TComponent::canSetProperty()
TComponent::createdOnTemplate()
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, 21 Apr 2008 11:34:58 -0400 by phpDocumentor 1.3.0RC4