Home > Archive > PHP Pear > May 2006 > Re: [PEAR] Question about Pager and DB_DataObject
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 |
Re: [PEAR] Question about Pager and DB_DataObject
|
|
| Massimiliano Arione 2006-05-26, 8:00 am |
| Jose Manuel Zea wrote:
> I started to use Pager with DB_DataObject to paginate get result lists. The
> problem is that the way I´m doing it is to get all the data and then pass it
> to the Pager, so if the amount of data is not filtered it could be very
> large if we have a lot of rows. I don´t know if there is a way of joining
> together Pager and DB_DataObject so only receive the data we want to
> visualize but we can get also the links to the other pages.
Of course there's a way.
Look into Pager/examples/Pager_Wrapper.php in your PEAR docs directory
--
Massimiliano Arione
http://garakkio.altervista.org
| |
| Jose Manuel Zea 2006-05-26, 8:00 am |
| Thank you very much!
That=B4s what I needed.
-----Mensaje original-----
De: Massimiliano Arione [mailto:garak@studenti.it]=20
Enviado el: viernes, 26 de mayo de 2006 12:39
Para: Jose Manuel Zea
CC: pear-general@lists.php.net
Asunto: Re: [PEAR] Question about Pager and DB_DataObject
Jose Manuel Zea wrote:
> I started to use Pager with DB_DataObject to paginate get result =
lists.
The
> problem is that the way I=B4m doing it is to get all the data and then =
pass
it
> to the Pager, so if the amount of data is not filtered it could be =
very
> large if we have a lot of rows. I don=B4t know if there is a way of =
joining
> together Pager and DB_DataObject so only receive the data we want to
> visualize but we can get also the links to the other pages.
Of course there's a way.
Look into Pager/examples/Pager_Wrapper.php in your PEAR docs directory
--=20
Massimiliano Arione
http://garakkio.altervista.org
--=20
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.7.0/346 - Release Date: =
23/05/2006
=20
________________________________________
______
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com
| |
| Justin Patrin 2006-05-26, 9:59 pm |
| On 5/26/06, Jose Manuel Zea <jmzeag@yahoo.es> wrote:
> Thank you very much!
>
> That=B4s what I needed.
>
You may also want to look into Structures_DataGrid which will print
out your data in a grid format. It has intelligent support for DB_DO
so it will only pull the relevant data.
> -----Mensaje original-----
> De: Massimiliano Arione [mailto:garak@studenti.it]
> Enviado el: viernes, 26 de mayo de 2006 12:39
> Para: Jose Manuel Zea
> CC: pear-general@lists.php.net
> Asunto: Re: [PEAR] Question about Pager and DB_DataObject
>
> Jose Manuel Zea wrote:
> The
pass[color=darkred]
> it
ning[color=darkred]
>
> Of course there's a way.
> Look into Pager/examples/Pager_Wrapper.php in your PEAR docs directory
>
> --
> Massimiliano Arione
>
> http://garakkio.altervista.org
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.392 / Virus Database: 268.7.0/346 - Release Date: 23/05/2006
>
>
>
>
> ________________________________________
______
> LLama Gratis a cualquier PC del Mundo.
> Llamadas a fijos y m=F3viles desde 1 c=E9ntimo por minuto.
> http://es.voice.yahoo.com
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--=20
Justin Patrin
| |
| Olivier Guilyardi 2006-05-26, 9:59 pm |
| Justin Patrin wrote:
> On 5/26/06, Jose Manuel Zea <jmzeag@yahoo.es> wrote:
>
>
> You may also want to look into Structures_DataGrid which will print
> out your data in a grid format. It has intelligent support for DB_DO
> so it will only pull the relevant data.
A simple tutorial about coupling Structures_DataGrid and DB_DataObject :
http://www.samalyse.com/code/pear/dgdo
Hope it helps
--
og
| |
| Jose Manuel Zea 2006-05-27, 8:00 am |
| Thank you, Justin and Olivier. Very interesting tutorial, clear and well
styled.
Only one question, following a previous email called, "ajaxing pager =
links",
I transformed the pager options to 'ajax' the links, this is what I did:
if ($this->ajax){
$params['append'] =3D false;
$params['path'] =3D '';
$params['fileName'] =3D 'java script:getPage(%d,''.$url.'')';
}
=20
// Obtener la lista de resultados paginada
$result =3D $this->Pager_Wrapper_DBDO($params);
Can I do something similar with Structures_DataGrid?
-----Mensaje original-----
De: Olivier Guilyardi [mailto:ojaiml@nerim.net]=20
Enviado el: viernes, 26 de mayo de 2006 23:15
Para: papercrane@reversefold.com
CC: Jose Manuel Zea; pear-general@lists.php.net
Asunto: Re: [PEAR] Question about Pager and DB_DataObject
Justin Patrin wrote:
> On 5/26/06, Jose Manuel Zea <jmzeag@yahoo.es> wrote:
>=20
>=20
> You may also want to look into Structures_DataGrid which will print
> out your data in a grid format. It has intelligent support for DB_DO
> so it will only pull the relevant data.
A simple tutorial about coupling Structures_DataGrid and DB_DataObject : =
http://www.samalyse.com/code/pear/dgdo
Hope it helps
________________________________________
______
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com
| |
| Olivier Guilyardi 2006-05-27, 8:00 am |
| Hi,
Jose Manuel Zea wrote:
> Thank you, Justin and Olivier. Very interesting tutorial, clear and well
> styled.
Glad you like it.
> Only one question, following a previous email called, "ajaxing pager links",
> I transformed the pager options to 'ajax' the links, this is what I did:
>
> if ($this->ajax){
> $params['append'] = false;
> $params['path'] = '';
> $params['fileName'] = 'java script:getPage(%d,''.$url.'')';
>
> }
>
> // Obtener la lista de resultados paginada
>
> $result = $this->Pager_Wrapper_DBDO($params);
>
> Can I do something similar with Structures_DataGrid?
Yes, in Structures_DataGrid 0.6.3 you can pass any Pager options as the 6th
argument of getPaging().
$renderer =& $datagrid->getRenderer();
echo $renderer->getPaging('Sliding', '|', '<<', '>>', 5, $params);
Or, with the current CVS version, you can use fill() :
$pager =& Pager::factory($params);
$datagrid->fill($pager);
echo $pager->links;
--
og
|
|
|
|
|