getControl() public method

Generates control's HTML element.
public getControl ( ) : Nette\Utils\Html
return Nette\Utils\Html
Esempio n. 1
0
 public function getControl()
 {
     $control = parent::getControl();
     $control->{'data-linkedelement'} = $this->linkedElement;
     $control->{'data-linkedproperty'} = $this->linkedProperty;
     return $control;
 }
Esempio n. 2
0
 /**
  * Generates control's HTML element.
  * @return Html
  */
 public function getControl()
 {
     $items = $this->getPrompt() === FALSE ? array() : array('' => $this->translate($this->getPrompt()));
     $translated = array();
     foreach ($this->items as $key => $value) {
         $translated[$key] = $this->translate($value);
     }
     asort($translated);
     return Helpers::createSelectBox($items + $translated, array('selected?' => $this->value, 'disabled:' => is_array($this->disabled) ? $this->disabled : NULL))->addAttributes(parent::getControl()->attrs);
 }
 /**
  * @return Html
  * @throws InvalidStateException
  */
 public function getControl()
 {
     $this->tryLoadItems();
     $control = parent::getControl();
     if ($this->multiple == TRUE) {
         $control->addAttributes(array('multiple' => TRUE));
     }
     if ($this->dependentCallback !== NULL) {
         $form = $this->getForm();
         if (!$form || !$form instanceof Form) {
             throw new InvalidStateException("DependentSelectBox supports only Nette\\Application\\UI\\Form.");
         }
         $control->attrs['data-dependentselectbox'] = $form->getPresenter()->link($this->lookupPath('Nette\\Application\\UI\\Presenter') . self::NAME_SEPARATOR . self::SIGNAL_NAME . '!');
         $parents = array();
         foreach ($this->parents as $parent) {
             $parents[$parent->getName()] = $parent->getHtmlId();
         }
         $control->attrs['data-dependentselectbox-parents'] = Json::encode($parents);
     }
     return $control;
 }
Esempio n. 4
0
 /**
  * Generates control's HTML element.
  * @return Nette\Utils\Html
  */
 public function getControl()
 {
     return parent::getControl()->multiple(TRUE);
 }
 /**
  * Generates control's HTML element
  *
  * @return \Nette\Utils\Html
  */
 public function getControl()
 {
     $control = parent::getControl();
     $control->class = 'imageselectbox';
     return $control;
 }
Esempio n. 6
0
 function getControl()
 {
     $control = parent::getControl();
     $control->multiple = TRUE;
     return $control;
 }
Esempio n. 7
0
parent::getHtmlName().'[]';}function
getControl(){$control=parent::getControl();$control->multiple=TRUE;return$control;}static
Esempio n. 8
0
 /**
  * @return Nette\Utils\Html
  */
 public function getControl()
 {
     if ($this->forceDisabled) {
         $this::setDisabled(TRUE);
     }
     return parent::getControl();
 }