public function renderJavascript(\Twig_Environment $twig, AbstractDataTable $table, $path = null, $options = [])
 {
     $table->setContainer($this->container);
     if (null === $path) {
         $path = $this->container->get('router')->generate('serverside_datatables_list', ['table' => null !== $table->getServiceId() ? $table->getServiceId() : get_class($table)]);
     }
     $tableVar = $table->getName();
     if (isset($options['var'])) {
         $tableVar = $options['var'];
         unset($options['var']);
     }
     $tableId = $table->getName();
     if (isset($options['id'])) {
         $tableId = $options['id'];
         unset($options['id']);
     }
     $deferLoading = null;
     if (true === $table->getOption('deferLoading')) {
         $request = new \Symfony\Component\HttpFoundation\Request();
         $request->query->add(['draw' => 0, 'start' => 0, 'length' => 10]);
         $response = $this->container->get('serverside_datatables')->processRequest($table, $request);
         $data = json_decode($response->getContent(), true);
         $deferLoading = ['total' => $data['recordsTotal'], 'filtered' => $data['recordsFiltered'], 'rows' => []];
         foreach ($data['data'] as $row) {
             $tmp = [];
             foreach ($row as $key => $value) {
                 if (0 === strpos($key, 'DT_')) {
                     continue;
                 }
                 $tmp[$key] = $value;
             }
             $deferLoading['rows'][] = $tmp;
         }
     }
     $result = $this->renderDefaults($twig);
     $result .= $twig->render('@VoelkelDataTables/table.js.twig', ['table' => $table, 'path' => $path, 'options' => $options, 'tableId' => $tableId, 'tableVar' => $tableVar, 'deferLoading' => $deferLoading]);
     return $result;
 }