| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\AjaxFields;
- use ThurData\Servers\KerioEmail\Core\UI\ResponseTemplates;
- /**
- * Select field controler
- *
- * @autor ThurData <info@thrudata.ch>
- */
- class SelectRemoteSearch extends Select
- {
-
- protected $id = 'ajaxSelectRemoteSearch';
- protected $name = 'ajaxSelectRemoteSearch';
- protected $vueComponent = true;
- protected $defaultVueComponentName = 'mg-ajax-select-rs';
- /**
- * do not overwrite this function
- * @return type \ThurData\Servers\KerioEmail\Core\UI\ResponseTemplates\RawDataJsonResponse
- */
- public function returnAjaxData()
- {
- $this->prepareAjaxData();
-
- $returnData = [
- 'options' => $this->getAvailableValues()
- ];
- return (new ResponseTemplates\RawDataJsonResponse($returnData))->setCallBackFunction($this->callBackFunction);
- }
- /**
- * overwrite this function, use setSelectedValue && setAvailableValues functions
- */
- public function prepareAjaxData()
- {
- $this->setAvailableValues([
- ['key' => '1', 'value' => 'value1'],
- ['key' => '2', 'value' => 'value2']
- ]);
- }
- public function initContent()
- {
- }
- }
|