/** * Return filter param by name * * @param string $name * @return string|array|null */ public function getFilterParam($name) { $prefix = $this->_filter->getPrefix(); if (null === $prefix) { return isset($this->_params[$name]) ? $this->_params[$name] : null; } if (!isset($this->_params[$prefix])) { return null; } return isset($this->_params[$prefix][$name]) ? $this->_params[$name] : null; }
/** * Generates a widget to show a html grid filter * * @param \Engine\Crud\Grid\Filter $filter * @return string */ public static function _(Filter $filter) { $filter->initForm(); $form = $filter->getForm(); $title = $filter->getTitle(); $code = "\n Ext.define('" . static::getFilterName() . "', {\n extend: 'Ext.ux.crud.Filter',\n alias: 'widget." . static::$_module . ucfirst(static::$_prefix) . "Filter',\n title: '" . $title . "',\n\n bodyPadding: 5,\n autoScroll: true,\n waitMsgTarget: true,\n border: false,\n fieldDefaults: {\n labelAlign: 'right',\n labelWidth: 85,\n msgTarget: 'side'\n },\n defaultType: 'textfield',\n defaults: {\n width: 280\n },\n buttonAlign: 'left',\n "; /*$width = $form->getWidth(); if ($width) { $code .= "width: ".$width.", "; } $height = $form->getHeight(); if ($width) { $code .= "height: ".$height.", "; }*/ static::addRequires("'Ext.form.field.*'"); static::addRequires("'Ext.ux.crud.Filter'"); $code .= "itemId: '" . static::$_module . ucfirst(static::$_prefix) . "Filter',\n "; return $code; }
/** * Generates a widget to show a html grid filter * * @param \Engine\Crud\Grid\Filter $filter * @return string */ public static function _(Filter $filter) { $filter->initForm(); $form = $filter->getForm(); $code = '<form method="' . $filter->getMethod() . '" action="' . $filter->getAction() . '" class="form-inline">'; $code .= "\n <fieldset>\n <legend>" . $filter->getTitle() . "</legend>"; return $code; }
/** * Generates form functions object * * @param \Engine\Crud\Grid\Filter $filter * @return string */ public static function _(Filter $filter) { $url = $filter->getAction() . "/read"; $code = "\n\n tbarGet: function() {\n return[\n ]\n },\n\n bbarGet: function() {\n return [\n ]\n },\n "; return $code; }