summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2006-06-28 01:36:35 +0000
committerxue <>2006-06-28 01:36:35 +0000
commit98ffb7a2cb6144de626093bdf5009444661f957c (patch)
tree9ac4a08f547dc21312e3bd8f70cdf8be017bc3d1
parentae57f5fb591ecc01c9cb007c4517efa5c4ff9e72 (diff)
Fixed #256, #257.
-rw-r--r--HISTORY2
-rw-r--r--framework/Web/UI/WebControls/TDataGrid.php2
-rw-r--r--framework/Web/UI/WebControls/TDataGridColumn.php22
-rw-r--r--framework/Web/UI/WebControls/TDataList.php2
4 files changed, 26 insertions, 2 deletions
diff --git a/HISTORY b/HISTORY
index 39b1e90d..3fa0bc00 100644
--- a/HISTORY
+++ b/HISTORY
@@ -14,6 +14,8 @@ ENH: Ticket#206 - Added OnValidate, OnError, OnSuccess events to validators (Qia
ENH: Ticket#230 - Added TDataList.EmptyTemplate property (Qiang)
ENH: Ticket#231 - Added TButton.ButtonType property to allow reset button (Qiang)
ENH: Ticket#232 - Allow <%# %> and <%= %> embedded within property values (Qiang)
+ENH: Ticket#256 - Datagrid columns can now be accessed via IDs (Qiang)
+ENH: Ticket#257 - OnSelectedIndexChanged event of TDataList and TDataGrid now passes the original command parameter (Qiang)
ENH: TRepeater, TDataList and TDataGrid will store data indices in DataKeys if DataKeyField is not set. (Qiang)
ENH: Added TPageService.BasePageClass property (Qiang)
ENH: Added TDataGrid.EmptyTemplate property (Qiang)
diff --git a/framework/Web/UI/WebControls/TDataGrid.php b/framework/Web/UI/WebControls/TDataGrid.php
index 342a39ac..f811edaf 100644
--- a/framework/Web/UI/WebControls/TDataGrid.php
+++ b/framework/Web/UI/WebControls/TDataGrid.php
@@ -634,7 +634,7 @@ class TDataGrid extends TBaseDataList implements INamingContainer
if(strcasecmp($command,self::CMD_SELECT)===0)
{
$this->setSelectedItemIndex($param->getItem()->getItemIndex());
- $this->onSelectedIndexChanged(null);
+ $this->onSelectedIndexChanged($param);
return true;
}
else if(strcasecmp($command,self::CMD_EDIT)===0)
diff --git a/framework/Web/UI/WebControls/TDataGridColumn.php b/framework/Web/UI/WebControls/TDataGridColumn.php
index e43b4895..fcb2e261 100644
--- a/framework/Web/UI/WebControls/TDataGridColumn.php
+++ b/framework/Web/UI/WebControls/TDataGridColumn.php
@@ -51,10 +51,32 @@ 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.
+ */
+ 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()
diff --git a/framework/Web/UI/WebControls/TDataList.php b/framework/Web/UI/WebControls/TDataList.php
index b6888225..48392b1d 100644
--- a/framework/Web/UI/WebControls/TDataList.php
+++ b/framework/Web/UI/WebControls/TDataList.php
@@ -677,7 +677,7 @@ class TDataList extends TBaseDataList implements INamingContainer, IRepeatInfoUs
if(strcasecmp($command,self::CMD_SELECT)===0)
{
$this->setSelectedItemIndex($param->getItem()->getItemIndex());
- $this->onSelectedIndexChanged(null);
+ $this->onSelectedIndexChanged($param);
return true;
}
else if(strcasecmp($command,self::CMD_EDIT)===0)