From a22a2853cc39aa26872f0d646348a3fc6eb722e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Konvi=C4=8Dka?= Date: Wed, 24 Sep 2025 14:04:21 +0200 Subject: [PATCH] =?UTF-8?q?https://trello.com/c/iiV3jHWx/5034-ve-vsech-gri?= =?UTF-8?q?dech-dat-aktivn=C3=AD-jako-druhy-sloupec-a-defaultne-neaktivni-?= =?UTF-8?q?skryt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 8 ++++++++ src/QueryObjectDataSource.php | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/composer.json b/composer.json index 120ef4e..f47d008 100644 --- a/composer.json +++ b/composer.json @@ -7,10 +7,18 @@ ], "require": { "php": ">=8.0", + "adt/datagrid-components": "dev-main", "adt/doctrine-components": "^3.0", "ublaboo/datagrid": "^6.0|^7.0", "nette/di": "^2.4|^3.0" }, + "repositories": [ + { + "type": "git", + "url": "https://github.com/AppsDevTeam/datagrid-components", + "no-api": true + } + ], "autoload": { "psr-4": { "ADT\\QueryObjectDataSource\\": "src/" diff --git a/src/QueryObjectDataSource.php b/src/QueryObjectDataSource.php index 95a3413..12ec4c1 100644 --- a/src/QueryObjectDataSource.php +++ b/src/QueryObjectDataSource.php @@ -2,8 +2,10 @@ namespace ADT\QueryObjectDataSource; +use ADT\Datagrid\Filter\FilterCheckbox; use ADT\DoctrineComponents\QueryObject\QueryObject; use ADT\DoctrineComponents\QueryObject\QueryObjectByMode; +use ADT\Datagrid\Filter\FilterSwitcher; use Contributte\Datagrid\DataSource\IDataSource; use Contributte\Datagrid\Exception\DatagridDateTimeHelperException; use DateTime; @@ -140,6 +142,12 @@ public function filter(array $filters): void if ($filter->getConditionCallback()) { call_user_func($filter->getConditionCallback(), $this->queryObject, $filter->getValue()); } + elseif ($filter instanceof FilterCheckbox || $filter instanceof FilterSwitcher) { + $this->queryObject->by( + $filter->getKey(), + $filter->getValue() + ); + } elseif ($filter instanceof FilterText) { $by = array_keys($filter->getCondition()); $value = $filter->getCondition()[$by[0]];