Hi,
I modified the button inside a subpanel like this:
array (
'widget_class' => 'SubPanelTopSelectButton',
'mode' => 'MultiSelect',
'initial_filter_fields' => array('id' => 'id_advanced'),
'field_to_name_array' => array('id' =>$this->_focus->id),
)
in this way, the filter starts from a selection based on the current id.
The first problem was that if I performed a search without entering any parameters, the id was ignored and a list of all the ids and not just the current one appeared, I solved this problem by inserting the line above:
'field_to_name_array' => array ('id' => $this -> _focus-> id),
and in module popupdefs:
if (isset($_REQUEST['request_data']) && !empty($_REQUEST['request_data'])) {
$tmp = json_decode(html_entity_decode($_REQUEST ['request_data']), true);
if (!empty($tmp['field_to_name_array']['id'])) {
$where_param = 'id_cantiere LIKE "'. $tmp ['field_to_name_array']['id']. '"';
}
}
and further down:
$popupMeta = array (
'moduleMain' => $module_name,
'varName' => $object_name,
'orderBy' => $_module_name. '.Name',
'whereClauses' => array (
'name' => $_module_name. '.Name',
)
'whereStatement' => $where_param,
'searchInputs' => array ($_module_name. '_number', 'name', 'priority', 'status'),
);
everything works fine, but if I select a record from the search list, the popup disappears and nothing happens, I expected the subpanel to be filled only by the selected element.
Furthermore, if I click again on the select button and do a search without setting any field, the list of all the ids and not just the current one is displayed and the field
$Tmp ['field_to_name_array']['id']
it is empty.
Please, can you help me, thank you.