Skip to content

Commit

Permalink
Update TAjaxSelect.php
Browse files Browse the repository at this point in the history
  • Loading branch information
peldax authored Dec 3, 2019
1 parent 8bdd065 commit 2733559
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Form/TAjaxSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,17 @@ public function signalReceived(string $signal): void

switch ($signal) {
case self::CALLBACK_SIGNAL_NAME:
$presenter->sendJson($this->getData($presenter->getParameter('q')));
$data = $this->getData($presenter->getParameter('q'));
$toJson = [];

foreach ($data as $key => $value) {
$toJson[] = [
'id' => $key,
'text' => $value,
];
}

$presenter->sendJson($toJson);
break;
case self::ONCHANGE_SIGNAL_NAME:
$this->fireOnchange($presenter->getParameter('s'));
Expand Down

0 comments on commit 2733559

Please sign in to comment.