所以我有两个自定义模块。它们是一对多相关的。模块 A vardef 有:`'lm_contacts' =>
array(
'name' => 'lm_contacts',
'type' => 'link',
'relationship' => 'lm_contacts_relation',
'source' => 'non-db',
'vname' => 'LBL_LEADS',
),
'relationships' =>
array (
'lm_contacts_relation' =>
array (
'lhs_module' => 'LM_LM_Objektas',
'lhs_table' => 'lm_lm_objektas',
'lhs_key' => 'id',
'rhs_module' => 'LM_LM_contact_person',
'rhs_table' => 'lm_lm_contact_person',
'rhs_key' => 'lm_object ',
'relationship_type' => 'one-to-many',
),
),
并且模块 a 有 subpaneldef:
$layout_defs['LM_LM_Objektas'] = array(
// list of what Subpanels to show in the DetailView
'subpanel_setup' =>
array(
'lm_contacts' =>
array(
'order' => 10,
'module' => 'LM_LM_contact_person',
'subpanel_name' => 'default',
'sort_order' => 'asc',
//'sort_by' => 'id',
'title_key' => 'LBL_CONTACT_SUBPANEL_TITLE',
'get_subpanel_data' => 'lm_contacts',
'add_subpanel_data' => 'lm_contacts_id',
'top_buttons' =>
array (
0 =>
array (
'widget_class' => 'SubPanelTopButtonQuickCreate',
),
1 =>
array (
'widget_class' => 'SubPanelTopSelectButton',
'mode' => 'MultiSelect',
'popup_module' => 'LM_LM_contact_person',
),
),
),
),
);
现在模块 a: lm_objectas 确实正确显示子面板,但是当我尝试通过子面板快速创建按钮向 lm_contacts 模块添加新请求时,确实创建了记录,但没有创建字段“'rhs_key' => 'lm_object'”的真实数据。所以自然不会显示子面板上的新记录。我错过了什么?谢谢!