Re: Re: Changing options when rendering twice datagrid

From: Date: Tue, 13 Jun 2006 11:52:43 +0000
Subject: Re: Re: Changing options when rendering twice datagrid
References: 1 2 3  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-24340@lists.php.net to get a copy of this message
Hi Michel, m.dhooge@enertecgroup.com wrote:
Well, in fact, my question should have been: Is there a clear definition of WHEN Structures_DataGrid_Renderer::init() is CALLED? And as important, when not called? Or stated differently, does Datagrid guarantee that it will only call once this method?
init() initializes rendering. It might be called several times. The most simple example is : init() { echo "<table>"; } If you call twice render(), you should get two tables
This works for me (not beautiful, but working *g*): $dg->render(null,
    array('headerAttributes' => array('bgcolor' => 'red')));
$dg->render(null,
    array('headerAttributes' => array('bgcolor' => 'green')));
According to me, this shouldn't... but you're right this works :-?
Why shouldn't it work ?
And I think I found the culprit: _restoreRenderer().
Or did I miss something?
_saveRenderer() and _restoreRenderer() are not used in Mark's example because the $type argument of render() is null. -- og

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