示例#1
0
 public function jsonDataAction()
 {
     $component = Kwf_Component_Data_Root::getInstance()->getComponentByDbId($this->_getParam('componentId'), array('ignoreVisible' => true));
     $row = $component->getComponent()->getRow();
     $select = new Kwf_Model_Select();
     $select->whereEquals('component_id', $this->_getParam('componentId'));
     $columnTypes = Kwc_Abstract::getSetting($this->_getParam('class'), 'columns');
     $typeName = array_shift(array_keys($columnTypes));
     if ($row && $row->type) {
         $typeName = $row->type;
     }
     $difference = count($columnTypes[$typeName]['colSpans']) - $this->_model->countRows($select);
     while ($difference > 0) {
         $this->_model->createRow(array('component_id' => $this->_getParam('componentId'), 'visible' => true))->save();
         $difference--;
     }
     parent::jsonDataAction();
 }