コード例 #1
0
 /**
  * Render the default table HTML
  *
  * @param DataResult $data
  * @return string
  */
 protected function renderTable(DataResult $data = null)
 {
     $html = '';
     $html .= "<table cellspacing=\"0\" class=\"{$this->config->getClass()}\" id=\"{$this->config->getTableId()}\">";
     $html .= "<thead><tr>";
     foreach ($this->config->getColumns() as $column) {
         if ($column->isVisible()) {
             $html .= "<th>{$column->getTitle()}</th>";
         } else {
             $html .= "<th style=\"display: none;\">{$column->getTitle()}</th>";
         }
     }
     $html .= "</tr></thead>";
     $html .= "<tbody>";
     if (!$this->config->isServerSideEnabled()) {
         $html .= $this->renderStaticData($data);
     } else {
         $html .= "<tr><td class=\"dataTables_empty\">{$this->config->getLoadingHtml()}</td></tr>";
     }
     $html .= "</tbody>";
     $html .= "</table>";
     $html .= "<!-- Built with italolelis/datatables -->";
     return $html;
 }