Re: Re: Re: Structures_DataGrid HTML_Template_Flexy renderer

From: Date: Wed, 08 Jun 2005 08:30:00 +0000
Subject: Re: Re: Re: Structures_DataGrid HTML_Template_Flexy renderer
References: 1 2 3 4 5  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-19511@lists.php.net to get a copy of this message
Hi Dan, your first post didn't get to list but I'll answer it here, too: >> I have overlooked it because of the tab/spaces problem. > > ??? Hmm I use eclipse IDE on a mac could that be the problem ? I dont > see the issues. 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. > Let me see I doubt the template could get the variable from within the > datagrid method. Which variable? 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) > Okies not everyone wants to say found 10 results in 10 pages for > instance ? Yes. Some people might also want to display the numbers of the records on the page (e.g. "record 11 to 20 from 50") or want to have in another language. > Ok i have made more tweaks to it, this time it returns the rendered > flexy object, and then i send it as a variable to an outer shell > template, in this outer shell template I call my custom getResults > method and the renderers getPaging method and the pager selectbox 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). 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. Mark

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