For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > July 2007 > Structures_DataGrid with Smarty and Pager









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Structures_DataGrid with Smarty and Pager
Professor

2007-07-27, 7:02 pm


I am attempting to use the Structures_DataGrid PEAR package with Smarty to
have the data paged. I am using the Array DataSource and whilst I have got
the table showing up fine, the data is never paged. There are 400 items in
the array but the output always says page 1 of 1.

The code is taken directly from the manual for the most part:

// Build data grid
require_once('Structures/DataGrid.php');
$datagrid =& new Structures_DataGrid();

// ... various $datagrid->addColumn calls ...

$datagrid->bind($users);

$datagrid->fill($smarty, array('convertEntities' => false));

$smarty->caching = false; // Don't want to cache this page
$smarty->display('list.tpl');

And in list.tpl I have the code copied directly from the manual e.g.

{getPaging prevImg="<<" nextImg=">>" separator=" | " delta="5"}

and so on.

This is the using the latest stable version of all the appropriate
Structures_* packages, Pager and PHP 5.2.3.

Why isn't it paging the data?
--
View this message in context: http://www.nabble.com/Structures_Da....html#a11835351
Sent from the Pear - General mailing list archive at Nabble.com.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com