fix: [element] Group context filter to support multiple conditions

pull/40/head
mokaddem 2021-02-24 11:10:52 +01:00
parent de4ba80e21
commit 00528112f1
1 changed files with 7 additions and 5 deletions

View File

@ -10,10 +10,10 @@
$currentQuery = $this->request->getQuery();
unset($currentQuery['page'], $currentQuery['limit'], $currentQuery['sort']);
if (!empty($filteringContext['filterCondition'])) { // PHP replaces `.` by `_` when fetching the request parameter
$currentFilteringContextKey = array_key_first($filteringContext['filterCondition']);
$currentFilteringContext = [
str_replace('.', '_', $currentFilteringContextKey) => $filteringContext['filterCondition'][$currentFilteringContextKey]
];
$currentFilteringContext = [];
foreach ($filteringContext['filterCondition'] as $currentFilteringContextKey => $value) {
$currentFilteringContext[str_replace('.', '_', $currentFilteringContextKey)] = $value;
}
} else {
$currentFilteringContext = $filteringContext['filterCondition'];
}
@ -23,7 +23,9 @@
'onClick' => 'changeIndexContext',
'onClickParams' => [
'this',
$this->Url->build($urlParams),
$this->Url->build($urlParams, [
'escape' => false, // URL builder escape `&` when multiple ? arguments
]),
"#table-container-${tableRandomValue}",
"#table-container-${tableRandomValue} table.table",
],