Last updated: 2020-11-16
Source: https://support.freshservice.com/support/solutions/articles/50000003069-custom-events
Self Service portal emits a number of events to help you do advanced customisations. You can listen to events at a document or container level.
Document Events
Events which can listened at a document level.
Example:
| $(document).on('PageChange', function(e) {<br>new FSToastr({<br> message: 'New Page Alert',<br> type: 'success'<br>}, true, true);<br>console.log(e.detail);<br>}); |
| PageUpdate | Fires when the page is updated |
| PageChange | Fires when the page is changed |
| SearchOpen | Fires when the search overlay is opened |
| SearchClose | Fires when the search overlay is closed |
| SideModalOpen | Fires when the side modal window is opened |
| SideModalRendered | Fires when the side modal window is rendered |
| SideModalClosed | Fires when the side modal window is closed |
| ModalOpen | Fires when the modal opens (used in Add People / Delegate Approvals / Change password) |
| ModalClose | Fires when the modal closes (used in Add People / Delegate Approvals / Change password) |
Container Events
Events which can be listened at a container level
Example:
| $('#search-results').on('SearchResult', function(e) {<br>new FSToastr({<br> message: 'Search Results updated',<br> type: 'success'<br>}, true, true);<br>console.log(e.detail);<br>}); |
| DOM Container | Event | Description |
| #search-results | SearchResult | Fires when the search result is rendered |
| #menu-icon, .menu-trigger | MenuOpen | Fires when the menu opens |
| MenuClose | Fires when the menu closes | |
| #ticket-attachments | AttachmentLoad | Fires when the user attaches a file |
| AttachmentDone | Fires when the attachment is uploaded | |
| select | SelectOpen | Fires when the user opens a dropdown |
| SelectClose | Fires when the user closes a dropdown |