Re: Datagrid and DataObject and performance

From: Date: Mon, 13 Dec 2004 22:35:28 +0000
Subject: Re: Datagrid and DataObject and performance
References: 1 2 3 4  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-16212@lists.php.net to get a copy of this message
Olivier Guilyardi a écrit :
cron@odi.com.br wrote:
I don't really need it, just playing around with some personal projects in the free time. Reading the docs just thought databject layer was ready and for now I will transform the dataobject into array pass to datagrid. When it comes out I will make the necessary changes. But if you fell like testing datagrid+dataobject I will be happy to do it.
The dataobject driver has been ready for months now. The problem lies into the interaction between the datagrid and the datasource layer (which the dataobject driver is part of). However, if you want to test the package (what I believe to be a great idea), you can fix the current cvs version by using the following patch (you can incorporate changes by hand. It's only two lines, where you need to write "$page = 1" instead of "$page = null"). Index: DataGrid.php =================================================================== RCS file: /repository/pear/Structures_DataGrid/DataGrid.php,v retrieving revision 1.10 diff -u -u -r1.10 DataGrid.php
--- DataGrid.php        10 Dec 2004 23:29:29 -0000      1.10
+++ DataGrid.php        13 Dec 2004 20:02:03 -0000
@@ -75,7 +75,7 @@
      * @return void
      * @access public
      */
-    function Structures_DataGrid($limit = null, $page = null,
+    function Structures_DataGrid($limit = null, $page = 1,
                                  $renderer = DATAGRID_RENDER_TABLE)
     {
         Structures_DataGrid_Renderer::Structures_DataGrid_Renderer($renderer, $limit, $page);
Index: DataGrid/Renderer.php =================================================================== RCS file: /repository/pear/Structures_DataGrid/DataGrid/Renderer.php,v retrieving revision 1.13 diff -u -u -r1.13 Renderer.php
--- DataGrid/Renderer.php       10 Dec 2004 23:35:46 -0000      1.13
+++ DataGrid/Renderer.php       13 Dec 2004 20:02:03 -0000
@@ -45,7 +45,7 @@
      * @param  string   $renderer   The renderer to use.
      * @access public
      */
-    function Structures_DataGrid_Renderer($renderer = DATAGRID_RENDER_TABLE, $limit = null, $page = null)
+    function Structures_DataGrid_Renderer($renderer = DATAGRID_RENDER_TABLE, $limit = null, $page = 1)
     {
         if (PEAR::isError($this->setRenderer($renderer))) {
             $this->setRenderer(DATAGRID_RENDER_TABLE);
-- og What am I doing wrong ? I only obtain the headers (whith links to sort, but fb_fieldlabels ignored), but no rows from my db_dataobject...
       require_once('Structures/DataGrid.php');
       $do = &DB_DataObject::factory('table');
       $test = 1;//idem with 2
       if ($test == 1) {
           require_once('Structures/DataGrid/Source.php');
           $dg = new Structures_DataGrid();
           $source =& Structures_DataGrid_DataSource::create($do);
           $dg->bindDataSource($source);
           $dg->render();
       } elseif($test==2) {
           $dg = new Structures_DataGrid();
           $dg->bind($do);
           $res = $dg->render();
       }


« previous php.pear.general (#16212) next »