PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

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
Extended by TApplicationComponent
Extended by TDataGridColumn
Extended by TEditCommandColumn

Direct known subclasses

TActiveEditCommandColumn
Package: System\Web\UI\WebControls
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 3.0
Located at Web/UI/WebControls/TEditCommandColumn.php
Methods summary
public TButtonColumnType
# getButtonType( )

Returns

TButtonColumnType
the type of command button. Defaults to TButtonColumnType::LinkButton.
public
# setButtonType( TButtonColumnType $value )

Parameters

$value
TButtonColumnType
the type of command button.
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

TDataGridColumn::initializeCell()
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 TApplicationComponent
getApplication(), getRequest(), getResponse(), getService(), getSession(), getUser(), publishAsset(), publishFilePath()
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()
Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO