Example #1
0
 /**
  * Render the default table HTML
  * 
  * @return string
  */
 protected function renderHtml()
 {
     $html = '';
     $html .= "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"{$this->config->getClass()}\" id=\"{$this->getTableId()}\">";
     $html .= "<thead><tr>";
     foreach ($this->config->getColumns() as $column) {
         $html .= "<th>{$column->getTitle()}</th>";
     }
     $html .= "</tr></thead>";
     $html .= "<tbody>";
     if (!$this->config->isServerSideEnabled()) {
         $html .= $this->renderStaticData();
     } else {
         $html .= "<tr><td class=\"dataTables_empty\">{$this->config->getLoadingHtml()}</td>";
     }
     $html .= "</tbody>";
     $html .= "<tfoot id=\"searchTFoot\" style=\"display: none;\"><tr>";
     foreach ($this->config->getColumns() as $column) {
         //$value = $this->getDataForColumn($object, $column);
         $value = $column->getTitle();
         if ($value == "") {
             $type = "hidden";
         } else {
             $type = "text";
         }
         if ($column->isVisible()) {
             $html .= "<th><input type='" . $type . "' name='search_" . $value . "' value='Search " . $value . "' class='search_init' /></th>";
         } else {
             $html .= "<th><input type='" . $type . "' name='search_" . $value . "' value='Search " . $value . "' class='search_init' /></th>";
         }
     }
     $html .= "</tr></tfoot>";
     $html .= "</table>";
     return $html;
 }
Example #2
0
 /**
  * Render the default table HTML
  * 
  * @return string
  */
 protected function renderHtml()
 {
     $html = '';
     $html .= "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"{$this->config->getClass()}\" id=\"{$this->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();
     } else {
         $html .= "<tr><td class=\"dataTables_empty\">{$this->config->getLoadingHtml()}</td>";
     }
     $html .= "</tbody>";
     $html .= "</table>";
     $html .= "<!-- Built with LampJunkie php-datatables -->";
     return $html;
 }