|
Class TEditCommandColumn
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 setEditText EditText, setUpdateText UpdateText, and setCancelText CancelText.
The buttons in the column can be set to display as hyperlinks, push or image
buttons by setting the setButtonType ButtonType property.
When an edit button is clicked, the datagrid will generate an onEditCommand OnEditCommand event. When an update/cancel button is clicked, the
datagrid will generate an onUpdateCommand OnUpdateCommand or an onCancelCommand OnCancelCommand You can write these event handlers to change
the state of specific datagrid item.
The setCausesValidation CausesValidation and 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.
-
TComponent
-
TApplicationComponent
-
TDataGridColumn
-
TEditCommandColumn
Methods summary
public
TButtonColumnType
|
#
getButtonType( )
Returns
TButtonColumnType
the type of command button. Defaults to TButtonColumnType::LinkButton.
|
public
|
|
public
string
|
#
getEditText( )
Returns
string the caption of the edit button. Defaults to 'Edit'.
|
public
|
#
setEditText( string $value )
Parameters
- $value
string the caption of the edit button
|
public
string
|
#
getEditImageUrl( )
Returns
string the URL of the image file for edit image buttons
|
public
|
#
setEditImageUrl( string $value )
Parameters
- $value
string the URL of the image file for edit image buttons
|
public
string
|
#
getUpdateText( )
Returns
string the caption of the update button. Defaults to 'Update'.
|
public
|
#
setUpdateText( string $value )
Parameters
- $value
string the caption of the update button
|
public
string
|
#
getUpdateImageUrl( )
Returns
string the URL of the image file for update image buttons
|
public
|
#
setUpdateImageUrl( string $value )
Parameters
- $value
string the URL of the image file for update image buttons
|
public
string
|
#
getCancelText( )
Returns
string the caption of the cancel button. Defaults to 'Cancel'.
|
public
|
#
setCancelText( string $value )
Parameters
- $value
string the caption of the cancel button
|
public
string
|
#
getCancelImageUrl( )
Returns
string the URL of the image file for cancel image buttons
|
public
|
#
setCancelImageUrl( string $value )
Parameters
- $value
string the URL of the image file for cancel image buttons
|
public
boolean
|
#
getCausesValidation( )
Returns
boolean whether postback event trigger by edit or update button will cause input
validation, default is true
|
public
|
#
setCausesValidation( boolean $value )
Parameters
- $value
boolean whether postback event trigger by edit or update button will cause input
validation
|
public
string
|
#
getValidationGroup( )
Returns
string the group of validators which the edit or update button causes validation upon
postback
|
public
|
#
setValidationGroup( string $value )
Parameters
- $value
string the group of validators which the edit or update button causes validation upon
postback
|
public
|
#
initializeCell( TTableCell $cell, integer $columnIndex, string $itemType )
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.
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.
Parameters
- $cell
TTableCell
the cell to be initialized.
- $columnIndex
integer the index to the Columns property that the cell resides in.
- $itemType
string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem)
Overrides
|
protected
mixed
|
#
createButton( string $commandName, string $text, boolean $causesValidation, string $validationGroup )
Creates a button and initializes its properties. The button type is
determined by getButtonType ButtonType.
Creates a button and initializes its properties. The button type is
determined by getButtonType ButtonType.
Parameters
- $commandName
string command name associated with the button
- $text
string button caption
- $causesValidation
boolean whether the button should cause validation
- $validationGroup
string the validation group that the button belongs to
Returns
mixed the newly created button.
|
Methods inherited from TDataGridColumn
formatDataValue(),
getAllowSorting(),
getDataFieldValue(),
getEnableCellGrouping(),
getFooterRenderer(),
getFooterStyle(),
getFooterText(),
getHeaderImageUrl(),
getHeaderRenderer(),
getHeaderStyle(),
getHeaderText(),
getID(),
getItemStyle(),
getOwner(),
getSortExpression(),
getViewState(),
getVisible(),
initialize(),
initializeFooterCell(),
initializeHeaderCell(),
loadState(),
saveState(),
setEnableCellGrouping(),
setFooterRenderer(),
setFooterText(),
setHeaderImageUrl(),
setHeaderRenderer(),
setHeaderText(),
setID(),
setOwner(),
setSortExpression(),
setViewState(),
setVisible()
|
Methods inherited from TComponent
__call(),
__construct(),
__destruct(),
__get(),
__isset(),
__set(),
__sleep(),
__unset(),
__wakeup(),
addParsedObject(),
asa(),
attachBehavior(),
attachBehaviors(),
attachClassBehavior(),
attachEventHandler(),
canGetProperty(),
canSetProperty(),
clearBehaviors(),
createdOnTemplate(),
detachBehavior(),
detachBehaviors(),
detachClassBehavior(),
detachEventHandler(),
disableBehavior(),
disableBehaviors(),
enableBehavior(),
enableBehaviors(),
evaluateExpression(),
evaluateStatements(),
fxAttachClassBehavior(),
fxDetachClassBehavior(),
getAutoGlobalListen(),
getBehaviorsEnabled(),
getClassHierarchy(),
getEventHandlers(),
getListeningToGlobalEvents(),
getSubProperty(),
hasEvent(),
hasEventHandler(),
hasProperty(),
isa(),
listen(),
raiseEvent(),
setSubProperty(),
unlisten()
|
|