Class: ProgressBar

Drupal. ProgressBar

new Drupal.ProgressBar(id, updateCallback, method, errorCallback)

A progressbar object. Initialized with the given id. Must be inserted into the DOM afterwards through progressBar.element.

Method is the function which will perform the HTTP request to get the progress bar state. Either "GET" or "POST".

Name Type Description
id string

The id for the progressbar.

updateCallback function

Callback to run on update.

method string

HTTP method to use.

errorCallback function

Callback to call on error.

pb = new Drupal.ProgressBar('myProgressBar');



Display errors on the page.

Name Type Description
string string

The error message to show the user.

Request progress data from server.

setProgress(percentage, message, label)

Set the percentage and status message for the progressbar.

Name Type Description
percentage number

The progress percentage.

message string

The message to show the user.

label string

The text for the progressbar label.

startMonitoring(uri, delay)

Start monitoring progress via Ajax.

Name Type Description
uri string

The URI to use for monitoring.

delay number

The delay for calling the monitoring URI.


Stop monitoring progress via Ajax.