PDA

View Full Version : Problem Using Progress Dialog



joxan
29 Mar 2007, 4:07 AM
HI

I have some problem with Progress dialog. My code im sharing here


Ext.onReady(function(){
Ext.get('mb9').on('click', function(){

Ext.MessageBox.show({
title: 'Please wait...',
msg: 'Initializing...',
width:240,
progress:true,
closable:false,
animEl: 'mb9'
});

// this hideous block creates the bogus progress
var f = function(v){
return function(){
if(v == 11){
Ext.MessageBox.hide();
centerLayout = parent.Example.getLayout();
centertabContent = centerLayout.getRegion('center');
panel = centertabContent.getActivePanel();
centerLayout.showPanel("cpMain1");

}else{
Ext.MessageBox.updateProgress(v/10, 'Loading item ' + v + ' of 10...');
}
};
};
for(var i = 1; i < 12; i++){
setTimeout(f(i), i*1000);
}
});

function showResult(btn){
Ext.example.msg('Button Click', 'You clicked the {0} button', btn);
};

function showResultText(btn, text){
Ext.example.msg('Button Click', 'You clicked the {0} button and entered the text "{1}".', btn, text);
};

});

What I want is on click a button i need to invoke a contentpanel ..Content panel is loding perfectly with new page which i want but issue is Progress bar shows till its time finishes say 10. It will show 10 out of 10. By this way i am just dilaying the page , Ia m not getting actual result of loding behind when content when porgress bar starts and it finish when page completely load. What modification i need to made to above code that i could get wht i really need.

i hav given th code for that like


centertabContent = centerLayout.getRegion('center');
panel = centertabContent.getActivePanel();
centerLayout.showPanel("cpMain1");

Thanks