Ejemplo n.º 1
0
 protected function _formatNode($row)
 {
     $data = parent::_formatNode($row);
     unset($data['children']);
     $select = $this->_model->select($this->_getTreeWhere($row));
     $select->whereEquals($this->_parentField, $row->{$this->_primaryKey});
     if ($this->_model->fetchCount($select)) {
         $id = $row->{$this->_primaryKey};
         $openedNodes = $this->_saveSessionNodeOpened(null, null);
         if ($openedNodes == 'all' || isset($openedNodes[$id]) && $openedNodes[$id] || isset($this->_openedNodes[$id]) || $this->_getParam('openedId') == $id) {
             $data['expanded'] = true;
         } else {
             $data['expanded'] = false;
         }
     } else {
         $data['children'] = array();
         $data['expanded'] = true;
     }
     return $data;
 }
 protected function _getSelect()
 {
     $ret = parent::_getSelect();
     $ret->whereEquals('component_id', $this->_getParam('componentId'));
     return $ret;
 }