window.widget_slareport_form = new class { init({serviceid_field_id}) { this._$service = jQuery(`#${serviceid_field_id}`); this._$service.multiSelect('getSelectButton').addEventListener('click', () => this.selectService()); } selectService() { const exclude_serviceids = []; for (const service of this._$service.multiSelect('getData')) { exclude_serviceids.push(service.id); } const overlay = PopUp('popup.services', { title: , exclude_serviceids, multiple: 0 }, {dialogueid: 'services'}); overlay.$dialogue[0].addEventListener('dialogue.submit', (e) => { const data = []; for (const service of e.detail) { data.push({id: service.serviceid, name: service.name}); } this._$service.multiSelect('addData', data); }); } };