ui.scheduleCallback Class
Schedule Callback UI Module
Item Index
Methods
- render static
Methods
render
(
Promise
static
-
config
Render the ScheduleCallback UI
Parameters:
-
config
ui.scheduleCallback.ConfigA ui.scheduleCallback.Config object
-
[uiInfo]
ui.UIInfo optional-
[type]
ui.HostType optionalA value in {{#crossLink "ui.HostType"}}{{/crossLink}} which indicates the type of UI to render e.g. IFRAME, POPUP. -
[containerSelector]
String optionalOnly required for iframe -- a JQuery selector statement to define the element into which the iframe will be loaded -
[height]
Number optionalThe height of the rendered UI -
[width]
Number optionalThe width of the rendered UI
-
-
Returns:
Promise:
A promise that resolves when the UI component has successfully loaded
Example:
// Modalities API must be called first to get the modalities object which is required to render scheduleCallback.
// Render scheduleCallback as an IFRAME.
// More UIInfo examples available here
var uiInfo = {
type: MsSupportSdk.ui.HostType.IFRAME,
containerSelector: "#iframe-container"
};
// Create a scheduleCallback config
var config = {
uiInfo: uiInfo
modalities: window.savedModalities, // See Modalities API examples about how to get the modalities object
onCallbackAccepted: function() {
console.log("Callback scheduled.");
},
onCallbackRejected: function (e) {
console.log("Callback rejected.");
}
};
// Render ScheduleCallback UI
MsSupportSdk.ui.scheduleCallback.render(config).then(
function() {
console.log("ScheduleCallback rendered successfully.");
},
function(err) {
console.log(err.message);
});