protected function buildDataTablesResponse(Request $request, $name, ActionResponse $output) {

        if (true === $request->isXmlHttpRequest()) {
            return new JsonResponse($output);
        }

        // Notify the user.
        switch ($output->getStatus()) {

            case 200:
                $this->notifySuccess($output->getNotify());
                break;

            case 404:
                $this->notifyDanger($output->getNotify());
                break;

            case 500:
                $this->notifyWarning($output->getNotify());
                break;
        }

        return $this->redirectToRoute("jquery_datatables_index", ["name" => $name]);
    }