This page was last edited on July 3, 2019, at 16:19.
Comments or questions about this documentation? Contact us for support!
Once you've registered your own plugin on the bus, you can call commands on other registered plugins. Below we'll quickly register a new plugin on the bus using the global bus object.
var oMyPlugin = window._genesys.widgets.bus.registerPlugin('MyPlugin');
oMyPlugin.command('Calendar.reset');
Internal use only. The main App plugin shares configuration settings to widgets using each widget’s configure command. The configure command can only be called once at startup. Calling configure again after startup may result in unpredictable behavior.
Builds and generates the calendar. Should subscribe to the events to get the generated calendar and display where you would like to.
oMyPlugin.command('Calendar.generate', {date: 'Mon Mar 20 2017 19:51:47 GMT-0700 (PDT)'}).done(function(e){
// Calendar generated successfully
}).fail(function(e){
// Calendar failed to generate
});
Option | Type | Description |
---|---|---|
date | Date string/object | To pre-select the date and time on calendar. |
Status | When | Returns |
---|---|---|
resolved | When the calendar is successfully generated | n/a |
rejected | When Invalid date is passed to calendar | 'Invalid data' |
Update the calendar timeslots with the callback availability. This enables only those timeslots that have the callback facility and disables the remaining.
oMyPlugin.command('Calendar.showAvailability', {date: '03/22/17'}).done(function(e){
// Calendar showed availability successfully
}).fail(function(e){
// Calendar failed to show availability
});
Option | Type | Description |
---|---|---|
date | Date string/object | Update the available time slots in the Calendar plugin for the selected Date. Note that, after calling this command, the internal showAvailability value is set to true for this session and the Calendar only shows the available time slots when switching between other dates. |
Status | When | Returns |
---|---|---|
resolved | When timeslots are successfully updated | n/a |
rejected | When no date value is found to check the availability | 'No date found to check availability' |
rejected | When invalid date value is found | 'Invalid date' |
Resets the calendar with no pre-selected values.
oMyPlugin.command('Calendar.reset').done(function(e){
// Calendar reset successfully
}).fail(function(e){
// Calendar failed to reset
});
Status | When | Returns |
---|---|---|
resolved | When calendar is successfully reset | n/a |