Your search did not match any results.
Progress Bar

Overview

API Reference
The dxProgressBar widget displays the current progress of operations - either by a specified value or by simple visual feedback. The Progress Bar allows you to set status message format and progress value range.
Copy to Codepen
Apply
Reset
$(function(){ var seconds = 10, inProgress = false; window.intervalId = window.intervalId || null; clearInterval(intervalId); var progressBarStatus = $("#progressBarStatus").dxProgressBar({ min: 0, max: 100, width: "90%", statusFormat: function(value) { return "Loading: " + value * 100 + "%"; }, onComplete: function(e){ inProgress = false; progressButton.option("text", "Restart progress"); e.element.addClass("complete"); } }).dxProgressBar("instance"); var progressButton = $("#progress-button").dxButton({ text: "Start progress", width: 200, onClick: function() { $("#progressBarStatus").removeClass("complete"); if (inProgress) { progressButton.option("text", "Continue progress"); clearInterval(intervalId); } else { progressButton.option("text", "Stop progress"); setCurrentStatus(); intervalId = setInterval(timer, 1000); } inProgress = !inProgress; } }).dxButton("instance"); function setCurrentStatus() { progressBarStatus.option("value", (10 - seconds) * 10); $("#timer").text(("0" + seconds).slice(-2)); } function timer() { seconds--; setCurrentStatus(); if(seconds === 0) { clearInterval(intervalId); seconds = 10; return; } } });
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>DevExtreme Demo</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <script src="js/jquery-3.1.0.min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/16.2.4/css/dx.spa.css" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/16.2.4/css/dx.common.css" /> <link rel="dx-theme" data-theme="generic.light" href="https://cdn3.devexpress.com/jslib/16.2.4/css/dx.light.css" /> <link rel="dx-theme" data-theme="android5.light" href="https://cdn3.devexpress.com/jslib/16.2.4/css/dx.android5.light.css" /> <link rel="dx-theme" data-theme="ios7.default" href="https://cdn3.devexpress.com/jslib/16.2.4/css/dx.ios7.default.css" /> <link rel="dx-theme" data-theme="win10.black" href="https://cdn3.devexpress.com/jslib/16.2.4/css/dx.win10.black.css" /> <link rel="dx-theme" data-theme="win10.white" href="https://cdn3.devexpress.com/jslib/16.2.4/css/dx.win10.white.css" /> <script src="https://cdn3.devexpress.com/jslib/16.2.4/js/dx.all.js"></script> <script src="data.js"></script> <link rel="stylesheet" type ="text/css" href ="styles.css" /> <script src="index.js"></script> </head> <body class="dx-viewport"> <div class="demo-container"> <div class="form"> <div id="progress-button"></div> <div class="progress-info"> Time left 00:00:<span id="timer">10</span> </div> <div id="progress"><div id="progressBarStatus"></div></div> </div> </div> </body> </html>
.form { padding: 20% 0; text-align: center; } #progress-button{ margin-bottom: 20px; } #progressBarStatus { display: inline-block; } .complete .dx-progressbar-range { background-color: green; }