Your search did not match any results.
ProgressBar

Progress Bar

Documentation
The ProgressBar is a widget that shows current progress.
Copy to CodePen
Apply
Reset
var DemoApp = angular.module('DemoApp', ['dx']); DemoApp.controller('DemoController', function DemoController($scope) { var seconds = 10, inProgress = false, intervalId; $scope.progressBarValue = 0; $scope.buttonText = "Start progress"; $scope.progressBarOptions = { min: 0, max: 100, width: "90%", bindingOptions: { value: "progressBarValue" }, statusFormat: function(value) { return "Loading: " + value * 100 + "%"; }, onComplete: function(e){ inProgress = false; $scope.buttonText = "Restart progress"; e.element.addClass("complete"); } }; $scope.buttonOptions = { width: 200, bindingOptions: { text: "buttonText" }, onClick: function() { $("#progressBarStatus").removeClass("complete"); if (inProgress) { $scope.buttonText = "Continue progress"; clearInterval(intervalId); } else { $scope.buttonText = "Stop progress"; setCurrentStatus(); intervalId = setInterval(timer, 1000); } inProgress = !inProgress; } }; function setCurrentStatus() { $scope.progressBarValue = (10 - seconds) * 10; $("#timer").text(("0" + seconds).slice(-2)); } function timer() { seconds--; $scope.$apply(function() { 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/17.1.7/css/dx.spa.css" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/17.1.7/css/dx.common.css" /> <link rel="dx-theme" data-theme="generic.light" href="https://cdn3.devexpress.com/jslib/17.1.7/css/dx.light.css" /> <link rel="dx-theme" data-theme="android5.light" href="https://cdn3.devexpress.com/jslib/17.1.7/css/dx.android5.light.css" /> <link rel="dx-theme" data-theme="ios7.default" href="https://cdn3.devexpress.com/jslib/17.1.7/css/dx.ios7.default.css" /> <link rel="dx-theme" data-theme="win10.black" href="https://cdn3.devexpress.com/jslib/17.1.7/css/dx.win10.black.css" /> <link rel="dx-theme" data-theme="win10.white" href="https://cdn3.devexpress.com/jslib/17.1.7/css/dx.win10.white.css" /> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.min.js"></script> <script>window.angular || document.write(decodeURIComponent('%3Cscript src="js/angular.min.js"%3E%3C\/script%3E'))</script> <script src="https://cdn3.devexpress.com/jslib/17.1.7/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" ng-app="DemoApp" ng-controller="DemoController"> <div class="form"> <div id="progress-button" dx-button="buttonOptions"></div> <div class="progress-info"> Time left 00:00:<span id="timer">10</span> </div> <div id="progress"> <div id="progressBarStatus" dx-progress-bar="progressBarOptions"></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; }