Reputation: 466
Problem:- I need to embed a progressbar that will run continuously until the completion of the operation.
ExtJS provides a Progressbar Ext.Progressbar which will:-
a) Run Continuously using wait method
b) Run after updating the updateProgress method.
In both the cases output of the progressbar will be
The solution that i am trying for is:-
Step 1 :
Step 2 :
Step 3 :
Kindly suggest me a solution or a approach. The JavaScript library that i am using is ExtJS. Thanks in Advance.
Links Referred for the example:-
http://dev.sencha.com/deploy/dev/examples/simple-widgets/progress-bar.html
Upvotes: 0
Views: 8931
Reputation: 46
Ext.get('buttonID').on('click', function(){
Ext.MessageBox.show({
msg: 'Saving your data, please wait...',
progressText: 'Saving...',
width:300,
wait:true,
waitConfig: {interval:200},
icon:'ext-mb-download',
animEl: 'buttonID'
});
setTimeout(function(){
//This simulates a long-running operation like a database save or XHR call.
//In real code, this would be in a callback function.
Ext.MessageBox.hide();
Ext.example.msg('Done', 'Your fake data was saved!');
}, 8000);
});
Upvotes: 1
Reputation:
Another approach using JavaScript: you could animate the left margin of a colored div (the progress indicator) within a parent div (the progress bar), using setTimeout or a simple animation library such as emile.js
ExtJS also provides an optional animation in setters of the Ext.Element class:
In both cases, you should provide a completion callback in animation options to reset the animation and loop.
Upvotes: 0
Reputation:
Here is a simple approach: you could create an animated Gif displaying the continuous progress bar that you described:
or if you want to display the empty progress bar before the operation and the complete progress bar after completion:
Upvotes: 1
Reputation: 90832
I gather Ext JS used to provide an indeterminate progress bar over three years ago, in 0.4; however due to the way browsers can stop animated GIFs it was removed. You could reinstate it with styles as indicated on that forum post - use something like Firebug to see what you should style.
Upvotes: 0