public function tableAjax(App_Grid_Filter $filter, array $list = null) { $req = Zend_Controller_Front::getInstance()->getRequest(); $this->_request = $req; $filter->setRequest($req); $ui = $filter->getUiName(); $this->_modelName = $filter->getModelName(); $tableConfig = $this->getTableConfig($this->_modelName, $ui); $this->_columnConfig = $tableConfig['fields']; $this->_modelConfig = $this->getModelConfig($this->_modelName); //print_r($this->_columnConfig); $widths = $filter->getRowWidths(); $titles = $filter->getheaderTitles(); //print_r($titles); $tWidth = $filter->getTableWidth(); if ($list == null) { $list = $filter->getList(); } $this->_filter = $filter; $view = $this->view; if (!$filter->isDisableHeader()) { // $view->headLink()->appendStylesheet('/scripts/jq-ingrid/css/ingrid.css'); // $view->headScript()->appendFile('/scripts/jq-ingrid/js/jquery.ingrid.js'); // $view->headScript()->appendFile('/scripts/jq-ingrid/js/jquery.cookie.js'); //$view->headScript()->appendScript($this->_getScript()); } $gridwidth = $filter->getGridWidth(); $table = '<div id="issues-preview-table"><table style="width:' . $gridwidth . '" class="extensions listing" cellpadding="0" cellspacing="0">'; //if( !$filter->isDisableHeader() ){ $table .= $this->_getHeader($widths, $titles); //} if (is_array($list)) { $table .= $this->_getRows($list, $widths); } else { $table .= $this->_getBlankRows(count($titles)); } //if( !$filter->isDisableHeader() ){ // $table .= $this->_getFooter(count($titles)); //} $table .= '</table>'; $table .= '</div>'; $table .= $this->_genPagination(); //$table .= '</div>'; //if (! $filter->isDisableScript ()) { //$table .='<script type="text/javascript">'; $this->_genScript(); //$table .= '</script> '; //} return $table; }
public function renderSimpleTable(App_Grid_Filter $filter, array $list = null) { $columnConfig = $this->_columnConfig; $table = ''; if ($list == null) { $list = $filter->getList(); } $widths = $filter->getCalibateCellWidths(); $titles = $filter->getheaderTitles(); //print_r($titles); $tWidth = $filter->getTableWidth(); $view = $this->view; $gridwidth = $filter->getGridWidth(); $table .= '<table id="' . $this->_gridid . '" width="100%" style="width:100%" cellspacing="3" cellpadding="4" class="extensions" >'; $table .= "<thead><tr>"; $i = 0; foreach ($titles as $index => $title) { $width = $widths[$i]; $table .= '<th style=" width:' . $width . ';" >'; $table .= ucfirst(App_Util::splitByCaps($this->_translate($title))); $table .= '</th>'; ++$i; } $table .= "</tr></thead><tbody>"; if (is_array($list)) { foreach ($list as $id => $row) { $table .= "<tr>"; $fileds = $filter->getFields(); foreach ($fileds as $filed) { $align = in_array($columnConfig->fields[$filed]->align, App_Model_Config::$alignList) ? $columnConfig->fields[$filed]->align : 'left'; $filedValue = $this->filter()->fieldTranform($row, $filed); $table .= '<td style="text-align:' . $align . '" >' . $filedValue . '</td>'; } $table .= "</tr>"; } } else { $table .= $this->_getBlankRows(count($titles)); } $table .= '</tbody></table>'; return $table; }