From 97d5ad831a6003418562b7f44e9a08e562d88a0c Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 4 Feb 2006 23:32:21 +0000 Subject: Added an example of TDataGrid showing updating and deleting functionalities. --- framework/Web/UI/WebControls/TDataGrid.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'framework/Web') diff --git a/framework/Web/UI/WebControls/TDataGrid.php b/framework/Web/UI/WebControls/TDataGrid.php index ac22fb9c..eceb498b 100644 --- a/framework/Web/UI/WebControls/TDataGrid.php +++ b/framework/Web/UI/WebControls/TDataGrid.php @@ -106,7 +106,7 @@ Prado::using('System.Web.UI.WebControls.TTable'); * @package System.Web.UI.WebControls * @since 3.0 */ -class TDataGrid extends TBaseDataList +class TDataGrid extends TBaseDataList implements INamingContainer { private $_columns=null; private $_autoColumns=null; @@ -820,7 +820,6 @@ class TDataGrid extends TBaseDataList $ds->setDataSource(new TDummyDataSource($itemCount)); else $ds->setDataSource(new TDummyDataSource($this->getViewState('DataSourceCount',0))); - $columns=new TList($this->getColumns()); $columns->mergeWith($this->_autoColumns); @@ -879,12 +878,14 @@ class TDataGrid extends TBaseDataList if($allowPaging && $ds->getCurrentPageIndex()>=$ds->getPageCount()) throw new TInvalidDataValueException('datagrid_currentpageindex_invalid'); // get all columns - $columns=new TList($this->getColumns()); if($this->getAutoGenerateColumns()) { + $columns=new TList($this->getColumns()); $autoColumns=$this->createAutoColumns($ds); $columns->mergeWith($autoColumns); } + else + $columns=$this->getColumns(); $items=$this->getItems(); -- cgit v1.2.3