Exemple #1
0
 /**
  * Generates control's HTML element.
  * @param  string
  * @return Nette\Utils\Html
  */
 public function getControl($caption = NULL)
 {
     $el = parent::getControl('');
     $el->type = 'submit';
     $el->class = $this->getClass();
     if ($this->getIcon()) {
         $el->addHtml(Html::el('span')->class(DataGrid::$icon_prefix . $this->getIcon()));
         if (strlen($this->getText())) {
             $el->addHtml(' ');
         }
     }
     $el->addText($this->grid->getTranslator()->translate($this->getText()));
     return $el;
 }
Exemple #2
0
	/**
	 * Generates control's HTML element.
	 * @param  string
	 * @return Nette\Utils\Html
	 */
	public function getControl($caption = NULL)
	{
		$scope = array();
		foreach ((array) $this->validationScope as $control) {
			$scope[] = $control->lookupPath('Nette\Forms\Form');
		}
		return parent::getControl($caption)->addAttributes(array(
			'formnovalidate' => $this->validationScope !== NULL,
			'data-nette-validation-scope' => $scope ?: NULL,
		));
	}