/**
  * Remove a datagrid view
  *
  * @param DatagridView $view
  *
  * @throws DeleteException If the current user doesn't own the view
  *
  * @return Response
  */
 public function removeAction(DatagridView $view)
 {
     if ($view->getOwner() !== $this->tokenStorage->getToken()->getUser()) {
         throw new DeleteException($this->translator->trans('flash.datagrid view.not removable'));
     }
     $this->datagridViewManager->remove($view);
     $this->request->getSession()->getFlashBag()->add('success', new Message('flash.datagrid view.removed'));
     return new Response('', 204);
 }
 /**
  * Remove a datagrid view
  *
  * @param Request      $request
  * @param DatagridView $view
  *
  * @throws DeleteException If the current user doesn't own the view
  *
  * @return Response
  */
 public function removeAction(Request $request, DatagridView $view)
 {
     if ($view->getOwner() !== $this->getUser()) {
         throw new DeleteException($this->getTranslator()->trans('flash.datagrid view.not removable'));
     }
     $this->datagridViewManager->remove($view);
     $this->addFlash('success', 'flash.datagrid view.removed');
     return new Response('', 204);
 }
 /**
  * List available datagrid columns
  *
  * @param string $alias
  *
  * @return JsonResponse
  */
 public function listColumnsAction($alias)
 {
     return new JsonResponse($this->datagridViewManager->getColumnChoices($alias));
 }