Re: Structures_DataGrid with Smarty and Pager
| From: | David Mytton | Date: | Fri, 27 Jul 2007 20:03:28 +0000 |
| Subject: | Re: Structures_DataGrid with Smarty and Pager | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-27748@lists.php.net to get a copy of this message | ||
An easy fix :) Thanks.
On 27/07/07, Luca Giandoso <luca.giandoso@gmail.com> wrote:
> You have to pass the number of records in a page, 10 for example:
>
> $datagrid =& new Structures_DataGrid(10);
>
>
> Luca Giandoso
>
> On 7/27/07, Professor <professoruncanny@gmail.com> wrote:
> >
> > 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_DataGrid-with-Smarty-and-Pager-tf4159753.html#a11835351
> > Sent from the Pear - General mailing list archive at Nabble.com.
> >
> > --
> > PEAR General Mailing List (http://pear.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>