summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY1
-rw-r--r--framework/Web/UI/ActiveControls/TActiveDataGrid.php17
-rw-r--r--framework/Web/UI/WebControls/TDataGrid.php14
3 files changed, 25 insertions, 7 deletions
diff --git a/HISTORY b/HISTORY
index cf9e0fdf..1ad2f77e 100644
--- a/HISTORY
+++ b/HISTORY
@@ -35,6 +35,7 @@ BUG: Issue #366 - Use divs instead of spans around tables in TActiveDataGrid (ct
BUG: Issue #365 - [Runtime Notice] Declaration of T${DriverName}MetaData::quoteTableName() should be compatible with that of TDbMetaData::quoteTableName() (Yves)
BUG: Issue #367 - Parameterized RegularExpression property in UrlMapping raise TPhpErrorException in DOMDocument::loadXML() (Yves)
BUG: Issue #368 - Clearing selection of a TActiveDropDownList in callback should select its prompt (ctrlaltca)
+BUG: Issue #371 - Sorting on TActiveDataGrid autogenerated column not work (ctrlaltca)
ENH: Performance (micro)optimization in TUrlMapping::loadUrlMappings - invoke `getDefaultMappingClass` outside of loop (Yves)
BUG: TActiveMultiView must update clientside only when necessary to get other active controls work fine inside it (ctrlaltca)
BUG: TListBox doesn't correctly reports selected indices to serverside on callback
diff --git a/framework/Web/UI/ActiveControls/TActiveDataGrid.php b/framework/Web/UI/ActiveControls/TActiveDataGrid.php
index bd32db5e..c4ad9640 100644
--- a/framework/Web/UI/ActiveControls/TActiveDataGrid.php
+++ b/framework/Web/UI/ActiveControls/TActiveDataGrid.php
@@ -52,10 +52,19 @@ Prado::using('System.Web.UI.WebControls.TCheckBoxColumn');
* @since 3.1.9
*/
class TActiveDataGrid extends TDataGrid implements IActiveControl, ISurroundable {
-/**
- * Creates a new callback control, sets the adapter to
- * TActiveControlAdapter.
- */
+
+ /**
+ * @return string Name of the class used in AutoGenerateColumns mode
+ */
+ protected function getAutoGenerateColumnName()
+ {
+ return 'TActiveBoundColumn';
+ }
+
+ /**
+ * Creates a new callback control, sets the adapter to
+ * TActiveControlAdapter.
+ */
public function __construct() {
parent::__construct();
$this->setAdapter(new TActiveControlAdapter($this));
diff --git a/framework/Web/UI/WebControls/TDataGrid.php b/framework/Web/UI/WebControls/TDataGrid.php
index 3d06363a..ede67b89 100644
--- a/framework/Web/UI/WebControls/TDataGrid.php
+++ b/framework/Web/UI/WebControls/TDataGrid.php
@@ -9,7 +9,7 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2011 PradoSoft
+ * @copyright Copyright &copy; 2005-2011 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.WebControls
@@ -227,6 +227,14 @@ class TDataGrid extends TBaseDataList implements INamingContainer
}
/**
+ * @return string Name of the class used in AutoGenerateColumns mode
+ */
+ protected function getAutoGenerateColumnName()
+ {
+ return 'TBoundColumn';
+ }
+
+ /**
* Adds objects parsed in template to datagrid.
* Datagrid columns are added into {@link getColumns Columns} collection.
* @param mixed object parsed in template
@@ -909,7 +917,7 @@ class TDataGrid extends TBaseDataList implements INamingContainer
$this->_autoColumns=new TDataGridColumnCollection($this);
foreach($state as $st)
{
- $column=new TBoundColumn;
+ $column=new $this->AutoGenerateColumnName;
$column->loadState($st);
$this->_autoColumns->add($column);
}
@@ -1404,7 +1412,7 @@ class TDataGrid extends TBaseDataList implements INamingContainer
{
foreach($row as $key=>$value)
{
- $column=new TBoundColumn;
+ $column=new $this->AutoGenerateColumnName;
if(is_string($key))
{
$column->setHeaderText($key);