PDA

View Full Version : EXTJS 4 ProgressBar



jeromer
1 Sep 2011, 2:20 PM
I have the following code in my app. When I update the progressbar like, CP.pgBar.updateProgress(.5), nothing happens. I suspect it has something to due with it being an item of a menu. I have stopped the app in debug and tried various ways to make the progress bar move. I want the progress update to take place in the saveTree function which the Ext.Array.each fires. I'm successful with the updateText method and reset, but not with updateProgress. Any suggestions?


var pgb = Ext.create('Ext.ProgressBar',{
text:'Updating...',
width:200
});

CP.pgBar = pgb;


var smenu = Ext.create('Ext.menu.Menu',{
width:200,
// height:75,
plain:true,
float:true,
shadow:true,
//margin: '5 5 5 5',
frame:true,
items:[
pgb
]
});

smenu.show();


//pgb.wait({interval:50000,increment:10,duration:50000,text:'Saving...',scope:this});



Ext.Array.each(r.childNodes,this.saveTree);

skirtle
3 Sep 2011, 8:40 AM
Just tried your code and it worked for me. 4.0.2 and 4.0.5, Chrome and FF.

My full test case was:


Ext.onReady(function() {
var pgb = Ext.create('Ext.ProgressBar', {
text: 'Updating...',
width: 200
});

var smenu = Ext.create('Ext.menu.Menu', {
width: 200,
plain: true,
float: true,
shadow: true,
frame: true,
items: [
pgb
]
});

smenu.show();

var prog = 0;

setInterval(function() {
prog = (prog + 5) % 105;

pgb.updateProgress(prog / 100);
}, 100);
});

Could you try with my test case? If it doesn't work could you tell us exactly which ExtJS version and browsers you're trying? If it does work then it suggests the problem lies in saveTree.

jeromer
7 Sep 2011, 8:36 AM
This works and I guess it's because of your other answer. The updateProgress() gets play time due to the delay caused by setInterval(). Sorry about the other post of same subject.

maurya971
3 Oct 2011, 2:19 AM
Hi All,
I m using progressBar, i want to change barcolor default Blue. can anyone please suggest me how i can do this.

Thanks

skirtle
3 Oct 2011, 6:26 AM
@maurya971. Please start a new thread, your question is unrelated to the original question in this thread.

zzhouag
30 Jul 2013, 9:15 AM
hi, I face the same problem, In my code


var waitMsg = Ext.MessageBox.show({
wait: true,
msg: 'Deleting data, please wait...',
width: 400,
waitConfig: {interval: 10, animate: true, text: 'Deleting...'}
});
Ext.Array.each(records, function(v){
v.destroy({...})

The loop will stop the bar progress moving, please help, thank you!