PDA

View Full Version : Progress Bar inside Window



rich9285
17 Jan 2013, 12:16 PM
Hi everyone,




I have a button that opens up a window. I want to put a progress bar inside the window but I am not sure how to do so. When I try to add the progress bar as an item inside the window definition, the progress bar appears on the top left of the page and not inside the window. Is there a way to put the progress bar inside the window? Here is the code for the progress bar.


var p = Ext.create('Ext.ProgressBar', {
id:'agentProgressBar',
xtype: 'agentprogressbar',
renderTo: 'testingwindow',
width: 300
});


//Wait for 5 seconds, then update the status el (progress bar will auto-reset)
p.wait({
interval: 500, //bar will move fast!
duration: 50000,
increment: 15,
text: 'Updating...',
scope: this,
fn: function(){
p.updateText('Done!');
}
});



I get an error that says "Uncaught TypeError: Cannot read property 'dom' of null"


Thanks in advance

skirtle
17 Jan 2013, 4:41 PM
Don't use renderTo, make the progressbar a child item using the items config of the window. Also make sure you have a suitable layout on the window.

You should also avoid the use of fixed component ids.