Re: Re: Re: Re: Structures_DataGrid HTML_Template_Flexy renderer

From: Date: Wed, 08 Jun 2005 08:53:44 +0000
Subject: Re: Re: Re: Re: Structures_DataGrid HTML_Template_Flexy renderer
References: 1 2 3 4 5 6  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-19512@lists.php.net to get a copy of this message
On 08/06/2005, at 6:30 PM, Mark Wiesemann wrote:
Open the .phps of your class in your browser, then you should see it. And also set the tabs setting in Eclipse to 4 spaces.
Right ok, I dont know what happened here.
Why not doing it like this? (after binding) $template->setVariable('statistics', 'found ' . $dg->getRecordCount() . ' records on ' . $dg->getPageCount()); (syntax may be wrong, I only know HTML_Template_Sigma)
From knowledge variables are gathered from the class instance sent to the output method. It couldnt possibly get a variable from the class with the datagrid method in it. I have however moved the compile of the final datagrid template back into datagrid method so it collects the getResults method from there.
I can't see everything of this as code on your website but it sounds to be the right way. Please apply my fix described in bug #4521 to your renderer, otherwise I have to open a new bug report after your renderer has been accepted. ;-) The getPaging() function should return the links array from Pager, not a string with only parts of the array. This is also for more flexibility and for more compatibility with HTMLTable renderer (which also returns the array).
eek right hmm. I simply call getPaging() in the datagrid template, its pretty clean. Looks like I have to handle a paging method in the class with the datagrid its sorta seperating the entire datagrid package then.
One comment to your data_grid function() itself (altough I'm not a DataObject expert): You don't need the "if (is_object($do)) {". Just do a $dg->bind($do). SDG recognizes whether $do is a DataObject instance or an array.
Heh right ??? Lemme see :P

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