From 98ffb7a2cb6144de626093bdf5009444661f957c Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 28 Jun 2006 01:36:35 +0000 Subject: Fixed #256, #257. --- framework/Web/UI/WebControls/TDataGrid.php | 2 +- framework/Web/UI/WebControls/TDataGridColumn.php | 22 ++++++++++++++++++++++ framework/Web/UI/WebControls/TDataList.php | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) (limited to 'framework') 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,9 +51,31 @@ 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 */ 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) -- cgit v1.2.3