/**
  * {@inheritdoc}
  */
 public function configure(DataGridInterface $datagrid)
 {
     $datagrid->setIdentifier($this->identifier);
     $eventHandlers = $this->manager->getOptions()->getEventHandlers();
     $eventHandlers->add(new LoadEventHandler(['function' => $this->getFunction('load'), 'route' => $this->manager->getRouteForAction('grid')]));
     $eventHandlers->add(new EditRowEventHandler(['function' => $this->getFunction('edit'), 'row_action' => OptionInterface::ACTION_EDIT, 'route' => $this->manager->getRouteForAction('edit')]));
     $eventHandlers->add(new ClickRowEventHandler(['function' => $this->getFunction('click'), 'route' => $this->manager->getRouteForAction('edit')]));
     $eventHandlers->add(new DeleteRowEventHandler(['function' => $this->getFunction('delete'), 'row_action' => OptionInterface::ACTION_DELETE, 'route' => $this->manager->getRouteForAction('delete')]));
     $datagrid->setRepository($this->repository);
     $datagrid->setManager($this->manager);
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function load(Request $request)
 {
     return $this->manager->getLoader()->getResults($this, $request);
 }