Esempio n. 1
0
 /**
  * @param BaseControl $wrappedControl
  * @param string      $componentName
  * @param string      $caption
  */
 public function __construct(BaseControl $wrappedControl, $componentName, $caption = 'Apply')
 {
     parent::__construct($caption);
     $this->wrappedControl = $wrappedControl;
     $this->componentName = $componentName;
     $this->applyButton = new SubmitButton($caption);
     $this->applyButton->setValidationScope(FALSE);
     $this->applyButton->onClick[] = function (SubmitButton $button) {
         $button->getForm()->onSuccess = array();
     };
     $this->control = $this->wrappedControl->controlPrototype;
     $this->label = $this->wrappedControl->labelPrototype;
 }
Esempio n. 2
0
 /**
  * @param string
  * @param string Kam se RequestButtonem dostanu (presenter a action).
  * @param array Kam se RequestButtonem dostanu (parametry).
  */
 public function __construct($caption = NULL, $destination = NULL, $destinationArgs = array())
 {
     parent::__construct($caption);
     parent::setValidationScope(false);
     $this->onClick = array(array($this, 'saveRequestAndRedirect'));
     $this->monitor('Nette\\Forms\\Form');
     $this->monitor('Nette\\Application\\UI\\Presenter');
     $this->setDestination($destination, $destinationArgs);
 }
 /**
  * @param string Text v buttonu.
  */
 public function __construct($caption = NULL)
 {
     parent::__construct($caption);
     parent::setValidationScope(false);
     $this->monitor('Nette\\Application\\UI\\Presenter');
 }
Esempio n. 4
0
 /**
  * @param  array|\Traversable $data
  * @param  Record $record
  * @param  callable $containerFactory
  * @param  string|NULL $iePrimary
  * @return Form
  */
 public function addInlineEditControls($data, Record $record, callable $containerFactory, $iePrimary)
 {
     if ($this->lazyCreateContainer('inline', 'buttons', $buttons)) {
         foreach ($data as $rec) {
             if ($record->is($rec, $iePrimary)) {
                 $this['inline']['values'] = $containerFactory($rec);
                 $buttons->addSubmit('edit', 'Edit')->setValidationScope([$this['inline']['values']]);
                 $buttons->addSubmit('cancel', 'Cancel')->setValidationScope([]);
             } else {
                 $submit = new SubmitButton('Edit inline');
                 $submit->setValidationScope([]);
                 $buttons[$record->primaryToString($rec)] = $submit;
             }
         }
     }
     return $this;
 }