Wait control

Last Update: 9/26/2016

See Use wait control for basic usage and advanced samples.

Create a wait control

TypeScript

  import Controls = require("VSS/Controls");
  import StatusIndicator = require("VSS/Controls/StatusIndicator");

  // Create the wait control in a container element
  var waitcontrol = Controls.create<StatusIndicator.WaitControl, StatusIndicator.IWaitControlOptions>(StatusIndicator.WaitControl, container, options);

JavaScript

  require(["VSS/Controls", "VSS/Controls/StatusIndicator"], function(Controls, StatusIndicator) {
      // Create the wait control in a container element
      var waitcontrol = Controls.create(StatusIndicator.WaitControl, container, options);
  });

Options

     {
        target: {JQuery},
        message: {string},
        messageFormat: {string},
        cancellable: {boolean},
        cancelTextFormat: {string},
        cancelCallback: {Function},
        fade: {boolean},
        showDelay: {number},
        backgroundColor: {string},
        image: {string}
    }
Option Type Default Notes
target JQuery window Target element in which an overlay and a message box is displayed. If not specified, whole window is used.
message string Text to be displayed in the message box.
messageFormat string Message format used if the cancellable is true. Defaut value is {message}({cancelText}).
cancellable boolean false Specifies whether this is control is cancellable or not. If yes, a cancel link is displayed in the message box.
cancelTextFormat string Press {0} to cancel Cancel text format used when displaying cancel text.
cancelCallback Function Callback executed when the control is cancelled.
fade boolean true Sepcifies whether to fade out the message box when the operation is cancelled or ended.
showDelay number 250 Specifies the amount of delay in milliseconds when the message box is displayed.
backgroundColor string Overlay color.
image string Progress image to be displayed.

Methods

startWait()

Starts waiting by displaying message box and overlay in the target element.

Returns

void

Parameters

  • cancellable: Utils_Core.Cancelable. Optional.

endWait()

Ends waiting by removing message box and overlay.

Returns

void

cancelWait()

Cancels waiting by removing message box and overlay.

Returns

void

setMessage()

Sets a new message for the displayed message box.

Returns

void

Parameters

  • message: string. Message to be displayed.

isCancelled()

Indicates whether the operation is cancelled or not.

Returns

boolean