Re: DataGrid and multiple renderers
| From: | Mark Wiesemann | Date: | Wed, 27 Sep 2006 09:07:55 +0000 |
| Subject: | Re: DataGrid and multiple renderers | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-25256@lists.php.net to get a copy of this message | ||
Chris Boget wrote:
> Is there a way to use multiple renderers with DataGrid. The renderers I'm
> particulary interested in is the XML and Pager. I can do the paging
> manually, but the only way I can think of would be a roundabout way using
> both DataObject->find() to get the subset I want and then another query to
> get the total number of records. Seems pretty inefficient to me. Since
> Pager already has the functionality I'm looking for, I thought I might be
> able to utilize it, too.
>
> So if it's possible to use both renderers, could someone point me to a
> resource online that discusses how? I've done some google searches but
> didn't come up with anything definitive one way or the other.
Ian has already given you an idea of how to do it. The direct answer on
your question is: Just call $dg->render(), $dg->fill() etc. with the
renderer you want to use. This can be done multiple times, e.g. render
first into XML data and then with Pager.
Regards,
Mark