Example #1
0
 /**
  * Saves item count in viewstate.
  * This method is invoked right before control state is to be saved.
  */
 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');
     }
 }
Example #2
0
 /**
  * Saves item count in viewstate.
  * This method is invoked right before control state is to be saved.
  */
 public function saveState()
 {
     parent::saveState();
     if ($this->_items) {
         $this->setViewState('ItemCount', $this->_items->getCount(), 0);
     } else {
         $this->clearViewState('ItemCount');
     }
 }