public function saveState()
{
parent::saveState();
if (!$this->getEnableViewState(true)) {
return;
}
if ($this->_items) {
$this->setViewState('ItemCount', $this->_items->getCount(), 0);
} else {
$this->clearViewState('ItemCount');
}
if ($this->_autoColumns) {
$state = array();
foreach ($this->_autoColumns as $column) {
$state[] = $column->saveState();
}
$this->setViewState('AutoColumns', $state, array());
} else {
$this->clearViewState('AutoColumns');
}
if ($this->_columns) {
$state = array();
foreach ($this->_columns as $column) {
$state[] = $column->saveState();
}
$this->setViewState('Columns', $state, array());
} else {
$this->clearViewState('Columns');
}
}