ui.callback Class
Callback UI Module
Item Index
Methods
- render static
Methods
render
(
Promise
static
-
config
Render the Callback UI
Parameters:
-
config
ObjectA ui.callback.Config object
-
[uiInfo]
Object optional-
[type]
String 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 callback.
// Render callback as an IFRAME.
// More UIInfo examples available here
var uiInfo = {
type: MsSupportSdk.ui.HostType.IFRAME,
containerSelector: "#iframe-container"
};
// Create a callback config
var config = {
uiInfo: uiInfo
modalities: window.savedModalities, // See Modalities API examples about how to get the modalities object
onCallbackAccepted: function() {
console.log("Callback accepted.");
},
onCallbackRejected: function (e) {
console.log("Callback rejected.");
}
};
// Render callback UI
MsSupportSdk.ui.callback.render(config).then(
function() {
console.log("Callback rendered successfully.");
},
function(err) {
console.log(err.message);
});