/** * Returns the viewstate of this control and its children. * This method is overriden to save the items data in view state. * @return array|null viewstate to be saved */ public function saveViewState() { $cols = array(); foreach ($this->columns as $column) { $cols[] = $column->saveViewState(); } $this->setViewState('Columns', $cols); return parent::saveViewState(); }
/** * Returns the viewstate of this control and its children. * This method is overriden to save the items data in view state. * @return array|null viewstate to be saved */ public function saveViewState() { if ($this->items->length() > 0) { $items = array(); foreach ($this->items as $item) { $items[$item->getItemIndex()] = $item->getData(); } $this->setViewState('Items', $items); } return parent::saveViewState(); }