Re: DataGrid and multiple renderers

From: Date: Thu, 28 Sep 2006 12:34:37 +0000
Subject: Re: DataGrid and multiple renderers
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-25272@lists.php.net to get a copy of this message
Chris From what I gather you are trying to Page an XML datasource driver? However you are drawing the data from a Database table USERS? A little confused here. It seems you are taking a DB table - rendering as XML and then paging this ? I have never seen this in any Appy before - usually render the DB table as HTML then offer an XML download of the result set ? Anyway .... I need to test more to see if this is possible. some snippets: // basics |$dataobject = new DataObject_Users(); $datagrid =& new Structures_DataGrid(10); $datagrid->bind($dataobject); // the Magic $datagrid->render();| // what i use - snippet from my code but helps a little $this->setRenderer('XML'); $this->addCustomColumns(); $renderer =& $this->getRenderer(); return $renderer->toXml(); Regards Ian Warner Director Triangle Solutions Ltd Mark Wiesemann wrote:
Chris Boget wrote:
echo $datagird->getOutput();
That's not needed, it's even bogus because it is responsible for the output of the HTML table (which is the default renderer).
If you don't use getOutput(), what are you using to get the rendered datagrid?
The render() method does what the name indicates: It renders the datagrid. In other words: It builds _and_ outputs (e.g.) the XML representation or the paging string. Regards, Mark


« previous php.pear.general (#25272) next »