public function getMetaData($model) { $ret = parent::getMetaData($model); unset($ret['store']); unset($ret['editable']); unset($ret['triggerAction']); if (isset($ret['outputType']) && $ret['outputType'] == 'vertical') { unset($ret['outputType']); if (!$this->getColumns()) { //set the default value for columns to 1, otherwise the radio buttons would be displayed in a row $ret['columns'] = 1; } $ret['vertical'] = true; } else { $ret['vertical'] = false; } $store = $this->_getStoreData(); if (!isset($store['data'])) { throw new Kwf_Exception("No data set for radio field '{$this->getName()}'"); } foreach ($store['data'] as $d) { $id = $d[0]; $value = $d[1]; $ret['items'][] = array('name' => $this->getFieldName(), 'boxLabel' => $value, 'inputValue' => $id); } return $ret; }
public function getMetaData($model) { $ret = parent::getMetaData($model); $saveCombo = $this->getFilteredCombo(); $saveMetaData = $saveCombo->getMetaData($model); $filterMetaData = $ret; $filterMetaData['xtype'] = 'combobox'; if (!$saveCombo->getFilterField()) { throw new Kwf_Exception("setFilterField(str) must be called for the save-combo-box"); } $data = $saveCombo->getValues(); if (is_array($data)) { $saveMetaData['store']['data'] = array(); foreach ($data as $k => $i) { $addArray = array(); foreach ($i as $i2) { $addArray[] = $i2; } $saveMetaData['store']['data'][] = $addArray; } } $ret['items'] = array($filterMetaData, $saveMetaData); return $ret; }