Example #1
0
 /**
  * {@inheritdoc}
  */
 protected function configureOptions(OptionsInterface $options)
 {
     $eventHandlers = $options->getEventHandlers();
     $eventHandlers->add(new LoadEventHandler(['function' => $this->getJavascriptFunctionName('load'), 'route' => $this->getRouteForAction('grid')]));
     $eventHandlers->add(new ClickRowEventHandler(['function' => $this->getJavascriptFunctionName('click'), 'route' => $this->getRouteForAction('edit')]));
     $eventHandlers->add(new CustomRowEventHandler(['function' => $this->getJavascriptFunctionName('install'), 'function_name' => 'installPackage', 'row_action' => 'action_installPackage']));
     $eventHandlers->add(new CustomRowEventHandler(['function' => $this->getJavascriptFunctionName('update'), 'function_name' => 'updatePackage', 'row_action' => 'action_updatePackage']));
     $eventHandlers->add(new CustomRowEventHandler(['function' => $this->getJavascriptFunctionName('remove'), 'function_name' => 'removePackage', 'row_action' => 'action_removePackage']));
 }
 /**
  * Configures DataGrid options
  *
  * @param OptionsInterface $options
  *
  * @return void
  */
 protected function configureOptions(OptionsInterface $options)
 {
     $eventHandlers = $options->getEventHandlers();
     $eventHandlers->add(new LoadEventHandler(['function' => $this->getJavascriptFunctionName('load'), 'route' => $this->getActionUrl('grid')]));
     $eventHandlers->add(new EditRowEventHandler(['function' => $this->getJavascriptFunctionName('edit'), 'row_action' => DataGridInterface::ACTION_EDIT, 'route' => $this->getActionUrl('edit')]));
     $eventHandlers->add(new ClickRowEventHandler(['function' => $this->getJavascriptFunctionName('click'), 'route' => $this->getActionUrl('edit')]));
     $eventHandlers->add(new DeleteRowEventHandler(['function' => $this->getJavascriptFunctionName('delete'), 'row_action' => DataGridInterface::ACTION_DELETE, 'route' => $this->getActionUrl('delete')]));
 }