Re: Structures_DataGrid_Renderer_Pager: showing the page that contains a given entry
| From: | Olivier Guilyardi | Date: | Mon, 15 Jan 2007 13:38:52 +0000 |
| Subject: | Re: Structures_DataGrid_Renderer_Pager: showing the page that contains a given entry | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-26345@lists.php.net to get a copy of this message | ||
Hi,
Mark Wiesemann wrote:
Sylvain Beucler wrote: [...]Mark, I think the page argument of the SDG constructor is not sufficient for Sylvain, because he wants to 'show entries "starting with" a given one'. Example: display 10 rows per page, the B letter starts at row 15 ; with the page argument he can only starts from a multiple of 10. So IMO, Sylvain you should simply bypass SDG page handling : $datagrid = new Structures_DataGrid(); $start = <compute at which row you want to start> $datagrid->bind("SELECT foo FROM bar LIMIT $start, 10"); And don't use the default Pager renderer, write your own "letter" driver. Regards, -- OlivierFeasible? :) I'd gladly implement the feature if that's helpful, though I'm not sure Structures_DataGrid is meant for it :/Actually I think that SDG is already able to do what you want it to do. If I got your idea right, you just need to follow my pointer on the code of the PEAR account list page, calculate the right page yourself, and pass this value to the SDG constructor.