Hi @fcsd,
Yes it should possible to create a subpanel in a custom module with a dropdown containing three options. Here are the steps I would try:
- Create a custom dropdown field in the related module with the three options you want to select.
- In the custom module’s vardefs, define the relationship to the related module and add a subpanel definition for the related module.
- In the subpanel definition, add a custom view that includes the dropdown field and any other fields you want to display.
- Customize the subpanel’s list view to filter the related records based on the selected option in the dropdown field.
Here’s an example of what the subpanel definition might look like in the custom module’s vardefs:
'contacts' => array(
'name' => 'contacts',
'type' => 'link',
'relationship' => 'custom_module_contacts',
'module' => 'Contacts',
'bean_name' => 'Contact',
'source' => 'non-db',
'vname' => 'LBL_CONTACTS_SUBPANEL_TITLE',
'id_name' => 'custom_module_contacts_id',
'link-type' => 'subpanel',
'tablist' => 'false',
'subpanel_name' => 'default',
'subpanel_layout' => array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopButtonQuickCreate'),
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'custom_module', 'mode' => 'MultiSelect', 'module' => 'Contacts', 'dropdown_field' => 'custom_dropdown_field'),
),
'components' => array(
array(
'view' => 'subpanel-for-custom-module',
'layout' => array(
'components' => array(
array(
'view' => 'subpanel-list',
'label' => 'LBL_CONTACTS_SUBPANEL_TITLE',
'module' => 'Contacts',
'panel_type' => 'default',
'filter_select' => array(
'dropdown_field' => 'custom_dropdown_field',
'options' => array(
'Option 1' => 'custom_filter_1',
'Option 2' => 'custom_filter_2',
'Option 3' => 'custom_filter_3',
),
),
'link_type' => 'related',
'columns' => array(
array('name' => 'full_name'),
array('name' => 'phone_work'),
array('name' => 'custom_dropdown_field'),
),
),
),
),
),
),
),
),
This is just an example and you will need to adjust it to fit your specific needs.