summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TDataGridColumn.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI/WebControls/TDataGridColumn.php')
-rw-r--r--framework/Web/UI/WebControls/TDataGridColumn.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/framework/Web/UI/WebControls/TDataGridColumn.php b/framework/Web/UI/WebControls/TDataGridColumn.php
index e43b4895..8c34b85f 100644
--- a/framework/Web/UI/WebControls/TDataGridColumn.php
+++ b/framework/Web/UI/WebControls/TDataGridColumn.php
@@ -51,10 +51,33 @@ Prado::using('System.Util.TDataFieldAccessor');
*/
abstract class TDataGridColumn extends TApplicationComponent
{
+ private $_id='';
private $_owner=null;
private $_viewState=array();
/**
+ * @return string the ID of the column.
+ */
+ public function getID()
+ {
+ return $this->_id;
+ }
+
+ /**
+ * Sets the ID of the column.
+ * By explicitly specifying the column ID, one can access the column
+ * by $templateControl->ColumnID.
+ * @param string the ID of the column.
+ * @throws TInvalidDataValueException if the ID is of bad format
+ */
+ public function setID($value)
+ {
+ if(!preg_match(TControl::ID_FORMAT,$value))
+ throw new TInvalidDataValueException('datagridcolumn_id_invalid',get_class($this),$value);
+ $this->_id=$value;
+ }
+
+ /**
* @return string the text to be displayed in the header of this column
*/
public function getHeaderText()