summaryrefslogtreecommitdiff
path: root/framework/Web/UI/ActiveControls/TActiveEditCommandColumn.php
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2015-01-20 22:34:11 +0100
committerFabio Bas <ctrlaltca@gmail.com>2015-01-20 22:34:11 +0100
commit7369988330bf8796d9cf2564756baf4eb46871ba (patch)
tree60a0bac5467b76ab6ed45328ed8c4e65703400b7 /framework/Web/UI/ActiveControls/TActiveEditCommandColumn.php
parentef4d964de440970b76ab48fcbd6748f43675efa3 (diff)
one class per file: framework/Web/UI/ActiveControls
Diffstat (limited to 'framework/Web/UI/ActiveControls/TActiveEditCommandColumn.php')
-rw-r--r--framework/Web/UI/ActiveControls/TActiveEditCommandColumn.php56
1 files changed, 56 insertions, 0 deletions
diff --git a/framework/Web/UI/ActiveControls/TActiveEditCommandColumn.php b/framework/Web/UI/ActiveControls/TActiveEditCommandColumn.php
new file mode 100644
index 00000000..4f658826
--- /dev/null
+++ b/framework/Web/UI/ActiveControls/TActiveEditCommandColumn.php
@@ -0,0 +1,56 @@
+<?php
+/**
+ * TActiveDataGrid class file
+ *
+ * @author LANDWEHR Computer und Software GmbH <programmierung@landwehr-software.de>
+ * @link http://www.landwehr-software.de/
+ * @copyright Copyright &copy; 2009 LANDWEHR Computer und Software GmbH
+ * @license http://www.pradosoft.com/license/
+ * @package System.Web.UI.ActiveControls
+ */
+
+
+/**
+ * TActiveEditCommandColumn class
+ *
+ * TActiveEditCommandColumn contains the Edit command buttons for editing data items in each row.
+ *
+ * TActiveEditCommandColumn 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 {@link setEditText EditText},
+ * {@link setUpdateText UpdateText}, and {@link setCancelText CancelText}.
+ *
+ * This is the active counterpart to the {@link TEditCommandColumn} control. The buttons for
+ * interaction are replaced by active buttons.
+ *
+ * Please refer to the original documentation of the {@link TEditCommandColumn} for usage.
+ *
+ * @author LANDWEHR Computer und Software GmbH <programmierung@landwehr-software.de>
+ * @package System.Web.UI.ActiveControls
+ * @since 3.1.9
+ */
+class TActiveEditCommandColumn extends TEditCommandColumn {
+ protected function createButton($commandName,$text,$causesValidation,$validationGroup) {
+ if($this->getButtonType()===TButtonColumnType::LinkButton)
+ $button=Prado::createComponent('System.Web.UI.WebControls.TActiveLinkButton');
+ else if($this->getButtonType()===TButtonColumnType::PushButton)
+ $button=Prado::createComponent('System.Web.UI.WebControls.TActiveButton');
+ else // image buttons
+ {
+ $button=Prado::createComponent('System.Web.UI.WebControls.TActiveImageButton');
+ $button->setToolTip($text);
+ if(strcasecmp($commandName,'Update')===0)
+ $url=$this->getUpdateImageUrl();
+ else if(strcasecmp($commandName,'Cancel')===0)
+ $url=$this->getCancelImageUrl();
+ else
+ $url=$this->getEditImageUrl();
+ $button->setImageUrl($url);
+ }
+ $button->setText($text);
+ $button->setCommandName($commandName);
+ $button->setCausesValidation($causesValidation);
+ $button->setValidationGroup($validationGroup);
+ return $button;
+ }
+} \ No newline at end of file