public function onCreate() { parent::onCreate(); $this->setRender('custombox'); }
public function generate() { $this->generateData(); $this->generateJsCode(); $header = $this->painter->generateToString($this->generateHeader()); $body = $this->painter->generateToString($this->generateBody()); $fields = $this->painter->generateToString($this->generateFields()); $footer = $this->painter->generateToString($this->generateFooter()); $class = 'mGrid' . ($this->scrollable ? '' : ' mGridNoScroll'); $grid = new MDiv($this->name . 'Div', array($header, $body, $fields, $footer), $class); if ($this->width != '') { $grid->addStyle('width', $this->width); } if ($this->scrollHeight != '') { $grid->addStyle('height', $this->scrollHeight); $grid->addStyle('overflow', 'auto'); } $this->generateEvent(); $hasForm = $this->form instanceof MBaseForm || $this->hasForm; if (!$hasForm) { $this->setForm(new MForm()); $this->form->setName('form' . ucfirst($this->name)); $this->form->addField($grid); return $this->form->generate(); } else { if ($this->caption != '') { $box = new MBox($this->caption, $this->close, ''); $box->setControls($grid); } else { $box = $grid; } return $box->generate(); } }