Exemplo n.º 1
0
 /**
  * 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;
 }
Exemplo n.º 2
0
 /**
  * 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;
 }