cvs: pear /Structures_DataGrid/DataGrid/Docs/Examples example-xls.php example-xml.php example-xul.php
| From: | Andrew Nagy | Date: | Fri, 22 Oct 2004 15:37:28 +0000 |
| Subject: | cvs: pear /Structures_DataGrid/DataGrid/Docs/Examples example-xls.php example-xml.php example-xul.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-25064@lists.php.net to get a copy of this message | ||
asnagy Fri Oct 22 11:37:28 2004 EDT
Modified files:
/pear/Structures_DataGrid/DataGrid/Docs/Examples example-xls.php
example-xml.php
example-xul.php
Log:
Changed adding records to binding
http://cvs.php.net/diff.php/pear/Structures_DataGrid/DataGrid/Docs/Examples/example-xls.php?r1=1.2&r2=1.3&ty=u
Index: pear/Structures_DataGrid/DataGrid/Docs/Examples/example-xls.php
diff -u pear/Structures_DataGrid/DataGrid/Docs/Examples/example-xls.php:1.2
pear/Structures_DataGrid/DataGrid/Docs/Examples/example-xls.php:1.3
--- pear/Structures_DataGrid/DataGrid/Docs/Examples/example-xls.php:1.2 Mon May 3 21:42:54 2004
+++ pear/Structures_DataGrid/DataGrid/Docs/Examples/example-xls.php Fri Oct 22 11:37:27 2004
@@ -32,20 +32,8 @@
$column = new Structures_DataGrid_Column('Age', 'age');
$dg->addColumn($column);
-
-// Add rows to the DataGrid
-foreach ($rs as $row) {
- $row = new Structures_DataGrid_Record($row);
- $result = $dg->addRecord($row);
- if (PEAR::isError($result)) {
- echo $result->getMessage();
- }
-}
-
-// Sort the array based on the field
-if (isset($_GET['orderBy'])) {
- $dg->sortRecordSet($_GET['orderBy'], $_GET['direction']);
-}
+// Bind to data set
+$dg->bind($rs);
// Print the DataGrid
$dg->renderer->setFilename('datagrid.xls');
http://cvs.php.net/diff.php/pear/Structures_DataGrid/DataGrid/Docs/Examples/example-xml.php?r1=1.2&r2=1.3&ty=u
Index: pear/Structures_DataGrid/DataGrid/Docs/Examples/example-xml.php
diff -u pear/Structures_DataGrid/DataGrid/Docs/Examples/example-xml.php:1.2
pear/Structures_DataGrid/DataGrid/Docs/Examples/example-xml.php:1.3
--- pear/Structures_DataGrid/DataGrid/Docs/Examples/example-xml.php:1.2 Mon May 3 21:42:54 2004
+++ pear/Structures_DataGrid/DataGrid/Docs/Examples/example-xml.php Fri Oct 22 11:37:27 2004
@@ -33,14 +33,8 @@
$column = new Structures_DataGrid_Column('Age', 'age');
$dg->addColumn($column);
-// Add rows to the DataGrid
-foreach ($rs as $row) {
- $row = new Structures_DataGrid_Record($row);
- $result = $dg->addRecord($row);
- if (PEAR::isError($result)) {
- echo $result->getMessage();
- }
-}
+// Bind data set
+$dg->bind($rs);
// Sort the array based on the field
$dg->sortRecordSet('age', 'DESC');
http://cvs.php.net/diff.php/pear/Structures_DataGrid/DataGrid/Docs/Examples/example-xul.php?r1=1.1&r2=1.2&ty=u
Index: pear/Structures_DataGrid/DataGrid/Docs/Examples/example-xul.php
diff -u pear/Structures_DataGrid/DataGrid/Docs/Examples/example-xul.php:1.1
pear/Structures_DataGrid/DataGrid/Docs/Examples/example-xul.php:1.2
--- pear/Structures_DataGrid/DataGrid/Docs/Examples/example-xul.php:1.1 Mon Aug 16 11:34:26 2004
+++ pear/Structures_DataGrid/DataGrid/Docs/Examples/example-xul.php Fri Oct 22 11:37:27 2004
@@ -33,14 +33,8 @@
$column = new Structures_DataGrid_Column('Age', 'age');
$dg->addColumn($column);
-// Add rows to the DataGrid
-foreach ($rs as $row) {
- $row = new Structures_DataGrid_Record($row);
- $result = $dg->addRecord($row);
- if (PEAR::isError($result)) {
- echo $result->getMessage();
- }
-}
+// Bind data set
+$dg->bind($rs);
// Sort the array based on the field
$dg->sortRecordSet('age', 'DESC');