summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorknut <>2008-08-09 01:30:05 +0000
committerknut <>2008-08-09 01:30:05 +0000
commit1c379275388c25657a6feda42b5d30115c0ce9bf (patch)
treec394fd33c875f21a547c9c07bd52efff48ef9747
parent0cb0583fa32038316dc1f56abb0fdd1933e84f00 (diff)
fixed #901
-rw-r--r--HISTORY1
-rw-r--r--framework/Web/UI/WebControls/TDataBoundControl.php8
2 files changed, 7 insertions, 2 deletions
diff --git a/HISTORY b/HISTORY
index acb8416f..678be1d5 100644
--- a/HISTORY
+++ b/HISTORY
@@ -20,6 +20,7 @@ ENH: Added MessageSource_Database to I18N (uses TDbConnection) (Michael)
ENH: Ticket#890 - Minor optimization: Use $var===null over is_null($var) (Knut)
ENH: Ticket#893 - Added page parameter to queryForPagedList() to specify the initial page to load (Michael)
ENH: Ticket#898 - Minor optimization: Use (int) over intval() (Knut)
+ENH: Ticket#901 - Using TDbDataReader directly as a DataSource of TDataBoundControl's like TDataGrid (Knut)
CHG: Ticket#844 - Upgraded TinyMCE to 3.1.0.1 (Christophe)
Version 3.1.2 April 21, 2008
diff --git a/framework/Web/UI/WebControls/TDataBoundControl.php b/framework/Web/UI/WebControls/TDataBoundControl.php
index 4bb89562..f816dd32 100644
--- a/framework/Web/UI/WebControls/TDataBoundControl.php
+++ b/framework/Web/UI/WebControls/TDataBoundControl.php
@@ -4,7 +4,7 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.WebControls
@@ -482,6 +482,10 @@ abstract class TDataBoundControl extends TWebControl
}
else if(is_array($value))
return new TMap($value);
+ else if($value instanceof TDbDataReader) {
+ // read array from TDbDataReader since it's forward-only stream and can only be traversed once
+ return $value->readAll();
+ }
else if(($value instanceof Traversable) || $value===null)
return $value;
else
@@ -580,4 +584,4 @@ interface IItemDataRenderer extends IDataRenderer
public function setItemType($value);
}
-?>
+?>