ui.survey Class
Survey UI Module
Item Index
Methods
- render static
Methods
render
(
Promise
static
-
config
Render the Survey UI
Parameters:
-
config
ui.survey.ConfigA ui.survey.Config object
-
[uiInfo]
ui.UIInfo optionalA ui.UIInfo object
-
[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 to a ui.survey.SDK object when the UI component has successfully loaded
Example:
// Render Survey as a POPUP.
// More UIInfo examples available here
var uiInfo = {
type: MsSupportSdk.ui.HostType.POPUP,
width: 600,
height: 800
};
// Create a survey config
var config = {
uiInfo: uiInfo
productId: "SMC",
surveyId: "smcsurvey",
locale: "en-us", // All parameters down to here are required
flightId: "abc123", // Optional flight ID. Default is empty. Used for testing. Forces the specified flight data from survey platform
preview: false, // Optional use preview flag. Default is false. Used for testing. Uses preview compass data
viewMode: "Wizard", // Optional view mode (Wizard | SinglePage). Default is Wizard.
envrionment: "https://survey.support.services.microsoft.com/ViewSurvey.html", // Optional environment (survey url).
surveyPlatformEnvironment: "Prod", // Optional default survey platform environment (Prod | PPE). Default is Prod.
onSurveyComplete: function() {
console.log("Survey completed");
}
};
// Render Survey agent UI
MsSupportSdk.ui.survey.render(config).then(
function() {
console.log("Survey rendered successfully.");
},
function(err) {
console.log(err.message);
});