[Structure_DataGrid] How to not display id but use id in editLink
| From: | digit Shine | Date: | Thu, 05 Jan 2006 09:43:11 +0000 |
| Subject: | [Structure_DataGrid] How to not display id but use id in editLink | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-22443@lists.php.net to get a copy of this message | ||
I do not want to display ID in DataGrid, but id will be used in edit link. How to get id when id
filed is not in the fb_fieldsToRender?
code e.g.
$dg_options = array(//'labels_property' => 'fb_fieldLabels',
//'fields_property' => 'fb_fieldsToRender',
//'sort_property' => 'fb_linkOrderFields',
'generate_columns' => true,
'formbuilder_integration' => true);
$dg->bind($do, $dg_options);
foreach ($dg->_dataSource->getColumns() as $col) {
$dg->addColumn($col);
}
$column = new Structures_DataGrid_Column('Edit', null, null,
array('align' => 'center'), null,
'Printer::printLink($label=Edit)');
$dg->addColumn($column);
function printLink($params) {
extract($params);
$id = $record['id'];
$html = '<a
href="'.$link.'?'.$className.'='.$id.'">'.$label.'</a>';
return $html;
}
---------------------------------
雅虎1G免费邮箱百分百防垃圾信
雅虎助手¨D搜索、杀毒、防骚扰