Window FAQ: Progress Dialog

Posted By Vitalii | March 20, 2012 | ExtJS 4.0.7
0 1953
Displays a message box with a progress bar. This message box has no buttons and is not closeable by the user. You are responsible for updating the progress bar as needed via updateProgress and closing the message box when the process is complete.

Js Code

Ext.widget('button', {
	text: 'Click Me',
	renderTo: 'output',
	handler: function (button) {
		button.disable();
		var progress = Ext.Msg.progress('Please wait', 'Progress...');
		var value = 0.0;
		var interval = setInterval(function () {
			value += 0.1;
			progress.updateProgress(Math.min(value, 1));
			if (value >= 1.0) {
				clearInterval(interval);
				progress.close();
				button.enable();
			}
		}, 500);
	}
});