Hi,
'extra' key means that field will be added in tab named "Details". If there are 'page splits', there will be more tabs with names defined in page_split.
Here is some example:
Utils_RecordBrowserCommon::install_new_recordset('custom_projects', array(
......
//three fields with extra defined to false - they will be in main record view
array('name'=>'Start Date', 'type'=>'date', 'required'=>false, 'param'=>64, 'visible'=>true, 'extra'=>false),
array('name'=>'Est End Date', 'type'=>'date', 'required'=>false, 'param'=>64, 'extra'=>false),
array('name'=>'Description', 'type'=>'long text', 'required'=>false, 'param'=>'64', 'extra'=>false),
// Extra Tab definition, named estimating
array('name'=>'Estimating', 'type'=>'page_split'),
// all fields below with extra param set to true will be placed under last page_split defined tab
array('name'=>'GC Job No', 'type'=>'text', 'required'=>false, 'param'=>'64', 'extra'=>true, 'visible'=>false),
array('name'=>'Bid Invitation Recvd', 'type'=>'date', 'required'=>false, 'param'=>64, 'extra'=>true),
array('name'=>'Bid Due Date', 'type'=>'date', 'required'=>false, 'param'=>64, 'extra'=>true),
array('name'=>'Drawings Recvd', 'type'=>'date', 'required'=>false, 'param'=>64, 'extra'=>true),
.......
));
This code is in install file.
Extra is not deprecated, and will not be. This feature is desired. But I think it's not what you are looking for. This doesn't create parent/child rows (two tables) - it's one table with additional columns, only layout is changed.
You are looking for something like that:
Install file:
//product parameters
$fields = array(
array('name'=>'Parameter Code', 'type'=>'text', 'param'=>128, 'required'=>true, 'extra'=>false, 'visible'=>true),
...........
);
Utils_RecordBrowserCommon::install_new_recordset('premium_ecommerce_parameters', $fields);
Utils_RecordBrowserCommon::set_favorites('premium_ecommerce_parameters', false);
Utils_RecordBrowserCommon::set_caption('premium_ecommerce_parameters', 'eCommerce - Parameters');
$fields = array(
array('name'=>'Parameter', 'type'=>'select', 'param'=>'premium_ecommerce_parameters::Parameter Code', 'required'=>true, 'extra'=>false),
array('name'=>'Language', 'type'=>'commondata', 'required'=>true, 'extra'=>false, 'param'=>array('Premium/Warehouse/eCommerce/Languages')),
array('name'=>'Label', 'type'=>'text', 'param'=>'128', 'required'=>true, 'extra'=>false)
);
Utils_RecordBrowserCommon::install_new_recordset('premium_ecommerce_parameter_labels', $fields);
Utils_RecordBrowserCommon::set_favorites('premium_ecommerce_parameter_labels', false);
Utils_RecordBrowserCommon::set_caption('premium_ecommerce_parameter_labels', 'eCommerce - Parameters');
Utils_RecordBrowserCommon::new_addon('premium_ecommerce_parameters', 'Premium/Warehouse/eCommerce', 'parameter_labels_addon', 'Labels');
And parameter_labels_addon function in main class:
public function parameter_labels_addon($arg) {
$rb = $this->init_module('Utils/RecordBrowser','premium_ecommerce_parameter_labels');
$xxx = array(array('parameter'=>$arg['id']), array('parameter'=>false,'language'=>true,'label'=>true), array('language'=>'ASC'));
$rb->set_defaults(array('parameter'=>$arg['id'],'language'=>Base_LangCommon::get_lang_code()));
$rb->set_header_properties(array(
'language'=>array('width'=>1, 'wrapmode'=>'nowrap'),
'label'=>array('width'=>50, 'wrapmode'=>'nowrap')
));
$this->display_module($rb,$xxx,'show_data');
}
This code creates tab with labels (translations) of parameters and this is the answer for question number one.
Cheers
Paul