Re: One more question: hidden datagrid columns
| From: | Olivier Guilyardi | Date: | Sun, 08 Jun 2008 12:46:32 +0000 |
| Subject: | Re: One more question: hidden datagrid columns | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-28994@lists.php.net to get a copy of this message | ||
Bernhard, please:
1 - answer on the list
2 - answer in the body of the mail, not at the top.
Bernhard Harb a écrit :
Thanks a lot! Any idea, if there is a chance to get the value of a hidden column with smarty renderer? I think smarty gets only the visible columns - does it?Well, I'm afraid you can't do that, because of the way SDG tries to separate presentation from data. Post a feature request if you like. However, I suspect all you need is a column formatter, where you can access all of the data. For example, to make a link: function makeLink($data) { $id = $data['record']['id']; $name = htmlspecialchars($data['record']['name']); return "<a href=\"show.php?id=$id\">$name</a>"; } $datagrid->generateColumns(array('name' => 'Name', 'phone' => 'Phone number')); $datagrid->getColumnByField('name')->setFormatter('makeLink'); $datagrid->bind('SELECT id, name, phone FROM addressbook'); This way you'll get clickable names. Regards, -- Olivier