API Docs for: 2.0.20156.1
Show:

ui.callback Class

Module: UI Callback
Parent Module: UI

Callback UI Module

Item Index

Methods

Methods

render

(
  • config
)
Promise static

Render the Callback UI

Parameters:

  • config Object
    • [uiInfo] Object optional

      A ui.UIInfo object ui.UIInfo

      • [type] String optional
        A value in {{#crossLink "ui.HostType"}}{{/crossLink}} which indicates the type of UI to render e.g. IFRAME, POPUP.
      • [containerSelector] String optional
        Only required for iframe -- a JQuery selector statement to define the element into which the iframe will be loaded
      • [height] Number optional
        The height of the rendered UI
      • [width] Number optional
        The 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);
    });