summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TEditCommandColumn.php
diff options
context:
space:
mode:
authorxue <>2006-08-27 23:26:55 +0000
committerxue <>2006-08-27 23:26:55 +0000
commitc1937cccd0985e86e247287faa9ac60870feecd7 (patch)
tree95ec7083c7be815184c74cd8aa27d02a69d2ea77 /framework/Web/UI/WebControls/TEditCommandColumn.php
parent887da1b3668499821f046665b461aeadb0a9fb2e (diff)
Merge from 3.0 branch till 1350.
Diffstat (limited to 'framework/Web/UI/WebControls/TEditCommandColumn.php')
-rw-r--r--framework/Web/UI/WebControls/TEditCommandColumn.php22
1 files changed, 19 insertions, 3 deletions
diff --git a/framework/Web/UI/WebControls/TEditCommandColumn.php b/framework/Web/UI/WebControls/TEditCommandColumn.php
index 65e389bd..c742ef11 100644
--- a/framework/Web/UI/WebControls/TEditCommandColumn.php
+++ b/framework/Web/UI/WebControls/TEditCommandColumn.php
@@ -38,6 +38,14 @@ Prado::using('System.Web.UI.WebControls.TDataGridColumn');
* 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:
+ * <code>
+ * $datagridItem->ButtonColumnID->EditButton (or UpdateButton, CancelButton)
+ * $datagridItem->ButtonColumnID->Controls[0]
+ * </code>
+ * The second method is possible because the button control created within the
+ * datagrid cell is the first child.
+ *
* @author Qiang Xue <qiang.xue@gmail.com>
* @version $Revision: $ $Date: $
* @package System.Web.UI.WebControls
@@ -154,13 +162,21 @@ class TEditCommandColumn extends TDataGridColumn
{
parent::initializeCell($cell,$columnIndex,$itemType);
if($itemType===TDataGrid::IT_ITEM || $itemType===TDataGrid::IT_ALTERNATINGITEM || $itemType===TDataGrid::IT_SELECTEDITEM)
- $cell->getControls()->add($this->createButton('Edit',$this->getEditText(),false,''));
+ {
+ $button=$this->createButton('Edit',$this->getEditText(),false,'');
+ $cell->getControls()->add($button);
+ $cell->registerObject('EditButton',$button);
+ }
else if($itemType===TDataGrid::IT_EDITITEM)
{
$controls=$cell->getControls();
- $controls->add($this->createButton('Update',$this->getUpdateText(),$this->getCausesValidation(),$this->getValidationGroup()));
+ $button=$this->createButton('Update',$this->getUpdateText(),$this->getCausesValidation(),$this->getValidationGroup());
+ $controls->add($button);
+ $cell->registerObject('UpdateButton',$button);
$controls->add('&nbsp;');
- $controls->add($this->createButton('Cancel',$this->getCancelText(),false,''));
+ $button=$this->createButton('Cancel',$this->getCancelText(),false,'');
+ $controls->add($button);
+ $cell->registerObject('CancelButton',$button);
}
}