Re: Re: Structures_DataGrid_Renderer_Smarty

From: Date: Fri, 20 Oct 2006 16:29:19 +0000
Subject: Re: Re: Structures_DataGrid_Renderer_Smarty
References: 1 2 3 4 5  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-25577@lists.php.net to get a copy of this message
Hi Chris, Chris Boget wrote:
I see that when it sets the value for the $recordSet variable, it does so using an associative array using integer values as keys for each column. Is there something I can do so that it instead uses the column name as the key?
Not directly. But this information is available via $columnSet in Smarty. For every numeric index you get in this array a link (or better said: an URL for sorting), the column name, the column label and the attributes for the column.
True. But unless I wanted to display the data from the DB table like how it is in the example template, the $columnSet isn't really going to help me. If I didn't want to display the column headers and/or if I wanted to explicitely position this column here and that column there, I'm not going to be working with the $columnSet at all. What I have to do now is access each column like: {$recordSet[row][0]} or {$recordSet[row][1]} which isn't all that big of a deal. But that assumes that the in which the fields are selected do not change and that the actual columns selected do not change. Do you see where I'm going here?
Yes, I see the problem. I'll send a copy of this mail to Olivier Guilyardi. He is the one who developed the Smarty renderer (not sure if he did the inital version, but he worked very much on it) and knows better why the design of the renderer is how it is. Regards, Mark

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