/** * Set object property */ public function setpropertyAction() { $id = Request::post('id', 'string', false); $property = Request::post('name', 'string', false); $value = Request::post('value', 'string', false); if (!$id || !$this->_object->columnExists($id)) { Response::jsonError($this->_lang->WRONG_REQUEST); } $object = $this->_object->getColumn($id); if (!$object->isValidProperty($property)) { Response::jsonError(); } if ($property === 'text') { $value = Request::post('value', 'raw', false); } $object->{$property} = $value; $this->_storeProject(); Response::jsonSuccess(); }
/** * Change grid column type */ public function changecoltypeAction() { $type = Request::post('type', 'string', ''); $columnId = Request::post('columnId', 'string', false); if (!$columnId) { Response::jsonError($this->_lang->WRONG_REQUEST); } if (strlen($type)) { $name = 'Grid_Column_' . ucfirst($type); } else { $name = 'Grid_Column'; } $col = Ext_Factory::object($name); Ext_Factory::copyProperties($this->_object->getColumn($columnId), $col); if (!$this->_object->updateColumn($columnId, $col)) { Response::jsonError($this->_lang->WRONG_REQUEST); } $this->_storeProject(); Response::jsonSuccess(); }