Skip to content

Commit

Permalink
Update TAjaxSelect.php
Browse files Browse the repository at this point in the history
  • Loading branch information
peldax authored Jun 13, 2019
1 parent bfe24b4 commit e9bcbd7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/Form/TAjaxSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,17 @@ public function getControl(): \Nette\Utils\Html
$attrs = [];
$control = parent::getControl();

$attrs['data-ajaxselect'] = $this->getForm()->getPresenter()->link(
$this->lookupPath(Presenter::class) . IComponent::NAME_SEPARATOR . self::CALLBACK_SIGNAL_NAME . '!'
);
if ($this->callback) {
$attrs['data-ajaxselect'] = $this->getForm()->getPresenter()->link(
$this->lookupPath(Presenter::class) . IComponent::NAME_SEPARATOR . self::CALLBACK_SIGNAL_NAME . '!'
);
}

$attrs['data-onchange'] = $this->getForm()->getPresenter()->link(
$this->lookupPath(Presenter::class) . IComponent::NAME_SEPARATOR . self::ONCHANGE_SIGNAL_NAME . '!'
);
if ($this->onchange) {
$attrs['data-onchange'] = $this->getForm()->getPresenter()->link(
$this->lookupPath(Presenter::class) . IComponent::NAME_SEPARATOR . self::ONCHANGE_SIGNAL_NAME . '!'
);
}

$control->addAttributes($attrs);
return $control;
Expand Down

0 comments on commit e9bcbd7

Please sign in to comment.