Re: structures Datagrid 0.6
| From: | Andrew S. Nagy | Date: | Sun, 26 Dec 2004 22:57:42 +0000 |
| Subject: | Re: structures Datagrid 0.6 | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16469@lists.php.net to get a copy of this message | ||
Check uut the new revised docs. With version .6 you must instantiate SDG as a reference:
$dg =& new Structures_DataGrid();
Alexander Petri wrote:
hi! i've tried the Complex example[Example 46-1] a very simple way, but i didnt get any results... i never got any results... can someone help me? require_once '../ini/config.php'; require_once('Structures/DataGrid.php'); // Determine sort order and direction as well as the page to display $page = isset($_GET['page']) ? $_GET['page'] : 1; $orderBy = isset($_GET['orderBy']) ? $_GET['orderBy'] : 'username'; $dir = isset($_GET['direction']) ? $_GET['direction'] : 'ASC'; // Define the Data Source for the DataGrid $user = DB_DataObject::factory('auth_user'); // Create the DataGrid, Bind it's Data Source and Define it's columns $dg = new Structures_DataGrid(40, $page); // Display 40 per page $dg->bind($user); $dg->sortRecordSet($orderBy, $dir); $dg->addColumn(new Structures_DataGrid_Column("Username", "username", "username")); // Define the Look and Feel $dg->renderer->setTableHeaderAttributes(array('bgcolor' => 'CCCCCC')); $dg->renderer->setTableEvenRowAttributes(array('bgcolor' => '#FFFFFF')); $dg->renderer->setTableOddRowAttributes(array('bgcolor' => '#EEEEEE')); $dg->renderer->setTableAttribute('width', '100%'); $dg->renderer->setTableAttribute('cellspacing', '0'); $dg->renderer->setTableAttribute('cellpadding', '4'); $dg->renderer->sortIconASC = '<'; $dg->renderer->sortIconDESC = '>'; // Print the DataGrid and the Paging $dg->render(); echo $dg->renderer->getPaging();