ublaboo/datagrid Inline edit bez akce
- martin28
- Člen | 40
Ahoj, prosim o pomoc.
Pouzivam ublaboo/datagrid a vse me u nej funguje jak potrebuji, vkladani, filtrovani…
az na addInlineEdit, kde po kliku na edit (tuzku) vpravo v akcich se me nic nestane. Tracy panelu me vyskoci novy radek AJAX coz je urcite dobre, ale bez moznosti editovat.
public function createComponentSimpleGridSoutezeDisciplina()
{
$grid = $this->gridFactory->create();
$grid->setDataSource($this->soutez->getItemsNastaveni( "discipliny" ));
$grid->addColumnText("nazev","Název")->setFilterText()->setExactSearch();
$grid->addInlineEdit()
->setIcon('pencil-alt')
->setTitle('Edit')
->setClass('text-black-50 ajax icon-edit')
->onControlAdd[] = function($container){
$container->addText('nazev','Název');
};
$grid->addInlineAdd()
->setPositionTop()
->setIcon('plus')
->setTitle('Add')
->setClass('btn btn-success ajax float-right')
->onControlAdd[] = function($container){
$container->addText('nazev','');
};
$grid->getInlineEdit()->onSetDefaults[] = function($container,$item){
$container->setDefaults([
'nazev' => $item["nazev"],
]);
};
$grid->getInlineEdit()->onSubmit[] = function($id, $values){
$values->id = $id;
$this->soutez->updateNastaveni("discipliny", $values, $this->getUser()->getIdentity());
$this->redirect('this');
};
$grid->getInlineAdd()->onSubmit[] = function($values){
$this->soutez->updateNastaveni("discipliny", $values, $this->getUser()->getIdentity());
$this->redirect('this');
};
$grid->addAction('delete', '', 'deleteSoutezDiscipliny!')
->setIcon('trash')
->setTitle('Smazat')
->setClass('text-black-50 icon-delete')
->setConfirmation(new \Ublaboo\DataGrid\Column\Action\Confirmation\StringConfirmation("Opravdu chcete smazat záznam?"));
$grid->setStrictSessionFilterValues(false);
return $grid;
}
dekuji Martin
Editoval martin28 (18. 5. 2021 23:58)
- Kamil Valenta
- Člen | 822
A když přidáš classu
->setClass('text-black-50 ajax icon-edit datagrid-inline-edit-trigger')
?
Editoval Kamil Valenta (18. 6. 2021 11:51)