azole
- azole 回复了话题 扩展CGridView的footer
根據版主的寫法改良的:
public function renderTableFooter() { $hasFilter=$this->filter!==null && $this->filterPosition===self::FILTER_POS_FOOTER; $hasFooter=$this->getHasFooter(); if($hasFilter || $hasFooter) { echo "<tfoot>\n"; if($hasFooter) { echo "<tr>\n"; $count = 0; foreach($this->columns as $column) { if($count == 0) $column->renderFooterCell(); else $count--; if($column -> getHasFooter()) $count = $column->footerHtmlOptions['colspan'] -1; } echo "</tr>\n"; } if($hasFilter) $this->renderFilter(); echo "</tfoot>\n"; } }