First of all I have to say that I really appreciate working with YII. It’s kind of magic how easy one can set up a complex web application with only some lines of code! Great work…!
Now my question:
is ist possible to have the header of a cgridview-table repeated as a footer with the same sorting possibilities as in the header? the attribute “footer” doesn’t seem to do the job for me…
i think it’s not possible by default. But you could try to solve this with some OOP style extending: First find out, where the header and footer are rendered by default (it’s done by some methods in CGridColumn/CDataColumn). Then you could create your custom column type class and override renderFooterCell() like this:
Yii::import('zii.widgets.grid.CDataColumn');
class MyDataColumn extends CDataColumn
{
public function renderFooterCell()
{
echo CHtml::openTag('td',$this->footerHtmlOptions);
$this->renderHeaderCellContent();
echo '</td>';
}
}
Then configure this class in your column definition.
I didn’t test this code, so maybe you have to tune a little. But eventually you should get it working.