new: [listTopBar:contextFilters] Added support of element to generate filter content

pull/121/head
Sami Mokaddem 2022-11-15 11:12:03 +01:00
parent f5b946d5a9
commit be7293a5a4
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 10 additions and 2 deletions

View File

@ -21,7 +21,7 @@
} else {
$currentFilteringContext = $filteringContext['filterCondition'];
}
$contextArray[] = [
$contextItem = [
'active' => (
(
$currentQuery == $currentFilteringContext && // query conditions match
@ -42,9 +42,17 @@
"#table-container-${tableRandomValue}",
"#table-container-${tableRandomValue} table.table",
],
'text' => $filteringContext['label'],
'class' => 'btn-sm'
];
if (!empty($filteringContext['viewElement'])) {
$contextItem['html'] = $this->element(
$filteringContext['viewElement'],
$filteringContext['viewElementParams'] ?? []
);
} else {
$contextItem['text'] = $filteringContext['label'];
}
$contextArray[] = $contextItem;
}
$dataGroup = [