Skip to content

Commit

Permalink
Správná filtrace řetězených sloupců
Browse files Browse the repository at this point in the history
zatím jen VS
  • Loading branch information
bojovyletoun committed Dec 8, 2022
1 parent 7af6b83 commit 65899a6
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions app/AdminModule/Components/GroupsGridControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
use App\Services\ExcelExportService;
use App\Utils\Helpers;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\QueryBuilder;
use Exception;
use Nette\Application\AbortException;
use Nette\Application\UI\Control;
use Nette\Http\Session;
use Nette\Http\SessionSection;
use Nette\Localization\Translator;
use Nette\Utils\Html;
use Throwable;
use Ublaboo\DataGrid\DataGrid;
use Ublaboo\DataGrid\Exception\DataGridColumnStatusException;
Expand Down Expand Up @@ -85,10 +85,16 @@ public function createComponentPatrolsGrid(string $name): DataGrid
->setSortable()
->setFilterText();

$grid->addColumnText('variableSymbol', 'VS ',"variableSymbolText")->setSortable() // je stejný jako název skupiny
->setFilterText();
$grid->addColumnText('variableSymbol', 'VS ', 'variableSymbolText')->setSortable() // je stejný jako název skupiny
->setFilterText()
->setCondition(static function (QueryBuilder $qb, string $value): void {
// $qb->join('p.applications', 'uAVS')
$qb->join('p.variableSymbol', 'VS')
->andWhere('VS.variableSymbol LIKE :variableSymbol')
->setParameter(':variableSymbol', '%' . $value . '%');
});

$grid->addColumnLink('leader', 'Vedoucí', ":detail", "leader.displayName" ,["id"=>"leader.id"])->setSortable()
$grid->addColumnLink('leader', 'Vedoucí', ':detail', 'leader.displayName', ['id' => 'leader.id'])->setSortable()
// return Html::el('a')->setAttribute('href', $this->getPresenter()->link('detail', $leader->getId()))->setText($leader->getDisplayName());
->setFilterText();

Expand Down

2 comments on commit 65899a6

@bojovyletoun
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tady je opravené to filtrování VS. Zbývá to pro ostatní sloupce udělat, ale chtěl jsem to mít poznamenané, když už jsem přišel jak na to.

@jan-stanek
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Můžeš z toho prosím udělat PR? I ten variabilní symbol by pomohl

Please sign in to comment.