diff options
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TDataGrid.php | 2 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TDataGridColumn.php | 22 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TDataList.php | 2 |
4 files changed, 26 insertions, 2 deletions
@@ -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)
|