new: [listTopBar:contextFilters] Added support of element to generate filter content
parent
f5b946d5a9
commit
be7293a5a4
|
@ -21,7 +21,7 @@
|
||||||
} else {
|
} else {
|
||||||
$currentFilteringContext = $filteringContext['filterCondition'];
|
$currentFilteringContext = $filteringContext['filterCondition'];
|
||||||
}
|
}
|
||||||
$contextArray[] = [
|
$contextItem = [
|
||||||
'active' => (
|
'active' => (
|
||||||
(
|
(
|
||||||
$currentQuery == $currentFilteringContext && // query conditions match
|
$currentQuery == $currentFilteringContext && // query conditions match
|
||||||
|
@ -42,9 +42,17 @@
|
||||||
"#table-container-${tableRandomValue}",
|
"#table-container-${tableRandomValue}",
|
||||||
"#table-container-${tableRandomValue} table.table",
|
"#table-container-${tableRandomValue} table.table",
|
||||||
],
|
],
|
||||||
'text' => $filteringContext['label'],
|
|
||||||
'class' => 'btn-sm'
|
'class' => 'btn-sm'
|
||||||
];
|
];
|
||||||
|
if (!empty($filteringContext['viewElement'])) {
|
||||||
|
$contextItem['html'] = $this->element(
|
||||||
|
$filteringContext['viewElement'],
|
||||||
|
$filteringContext['viewElementParams'] ?? []
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$contextItem['text'] = $filteringContext['label'];
|
||||||
|
}
|
||||||
|
$contextArray[] = $contextItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
$dataGroup = [
|
$dataGroup = [
|
||||||
|
|
Loading…
Reference in New Issue