Pokročilé filtrovanie v Ublaboo/Datagride
- KristianSubweb
- Člen | 146
Ahojte chcel by som sa opýtať potreboval by som filtrovať v tabulke Billboardy tak že Billboardy sú naviazené na tabulku OrderBillboards v nej sa definuje od kedy do kedy su jednotlivé billboardy objednané. A ja by som potreboval filtrovanie prave na tejto úrovni. Nevedeli by ste niekto poradiť ako saké niečo spraviť.
$grid = $this->datagridFactory->createDatagrid($this, $order, $name);
$grid->addColumnLink("address", "is.billboard.address", "viewBillboard");
$grid->addColumnText("billboardCategory", "is.billboard.billboardCategory")
->setRenderer(function ($item) {
return "<span class='label' style='background:" . DefaultValues::getBillboardColor()[$item->billboardCategory] . "'>" . DefaultValues::getBillboardCategory()[$item->billboardCategory] . "</span>";
})->setTemplateEscaping(FALSE);
$grid->addColumnText("luminosity", "is.billboard.luminosity")
->setRenderer(function ($item){
return "<span class='label' style='background:" . DefaultValues::getLuminosityColor()[$item->luminosity] . "'>" . DefaultValues::getBillboardLuminosity()[$item->luminosity] . "</span>";
})->setTemplateEscaping(FALSE);
$grid->addColumnText("typeTrip", "is.billboard.typeTrip")
->setRenderer(function ($item) {
return DefaultValues::getBillboardTypeTrip()[$item->typeTrip];
})->setTemplateEscaping(FALSE);
$grid->addColumnText("monthPrice", "is.billboard.monthPrice");
if ($this->showFilter) {
$grid->addFilterText("address", "is.billboard.address");
$grid->addFilterText("billboardCategory", "is.billboard.billboardCategory");
$grid->addFilterText("luminosity", "is.billboard.luminosity");
$grid->addFilterText("typeTrip", "is.billboard.typeTrip");
$grid->addFilterText("monthPrice", "is.billboard.monthPrice");
$grid->addFilterDateRange("volne", "volne")->set
$grid->setOuterFilterRendering(TRUE);
$grid->addToolbarButton("default", "", ["showFilter" => FALSE])
->setIcon("filter");
} else {
$grid->addToolbarButton("default", "", ["showFilter" => TRUE])
->setIcon("filter");
}
return $grid;
Tak hádam už niekto niekedy riešil niečo podobné. Ďakujem vopred za odpovede.