Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.2.2dev1

Request #6380 Formbuilder support: Please add primary key
Submitted: 2005-12-31 14:16 UTC
From: xolphin Assigned: olivierg
Status: Closed Package: Structures_DataGrid_DataSource_DataObject
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    

 [2005-12-31 14:16 UTC] xolphin
Description: ------------ There are situation where I would like to use the primary key in the formatter to make for example an Edit link, but I don't want it to be displayed to the end-user. At the moment this isn't possible when using FormBuilder in combination with DataGrid. A small code change makes this possible. Please add the following in DataGrid/DataSource/DataObject.php on line 243 just before "// Build DataSet": $fieldList = array_merge($fieldList, array(0 => DB_DataObject_FormBuilder::_getPrimaryKey($this->_dataobject)));


 [2006-06-20 16:46 UTC] wiesemann (Mark Wiesemann)
changed package
 [2006-06-21 12:22 UTC] pajoye (Pierre-Alain Joye)
change package back to SDG
 [2006-12-14 01:05 UTC] olivierg at php dot net (Olivier Guilyardi)
Now that bug #7710 is fixed (in CVS), you can decide not to render all of the fields that you fetch from the datasource. It should not be necessary to modify the DataObject driver to do what you need, wether you use DBDO_FormBuilder or not. Edit Link Example: // Fetch the primary key and two other fields $options = array('fields' => array('pk', 'f1', 'f2')); $datagrid->bind($dataobject, $options); // Add an edit link, using the primary key in your formatter $datagrid->addColumn("Edit", ...) // Don't render the primary key $datagrid->generateColumns(array('f1' => 'Field 1', 'f2' => 'Field 2')); $datagrid->render(); Feel free to reopen this request if this does not answer your need. Thanks for your report