Keeping a running total in a CGridView

Comparing #5 with #6

Revision #6 was created by tydeas_dr tydeas_dr on May 2, 2011, 11:52:40 AM.

corrected syntax error

Content

[...]
public $type = 'number'; //If you want to be able to access it.
...
public function renderDataCellContent($row, $data) {
$this->_total += $data->{$this->attribute};

echo (isset($this->type)) ?
  $ $this->grid->getFormatter()->format($this->_total, $this->type) : this->_total; } } ```