简体   繁体   中英

Add progressbar inside Ext.window

Could anyone help me insert below progress bar inside Ext.window? or any other suggestions to add a progress bar inside Ext.window?

   var p = Ext.create('Ext.ProgressBar', {
                    renderTo: Ext.body(),
                    width: 300
                });
                p.wait({
                    interval: 500, //bar will move fast!
                    duration: 50000,
                    increment: 100,
                    text: 'Updating',
                    scope: this,
                    fn: function () {
                        p.updateText('Done!');
                    }
                });

I want to insert progress bar in below window

var window = new Ext.Window({
            title: "export",
            height: 100,
            layout: 'fit',
            buttons: [
                {
                    text: 'Cancel',
                    listeners: {
                        click: function () {
                            window.close();
                        }
                    }
                }
            ],
            items: [{
                xtype: 'download',

                autoEl: {
                        tag: 'iframe',
                        src: 'www.google.com'

                    }
                }]
        }).show();

You have multiple ways to do that. You could add the existing progress bar to the existing window:

window.add(p);

Or add the existing progress bar when creating the window:

new Ext.Window({
    items: [p]
);

Or create a new progress bar when creating the window:

new Ext.Window({
    items: [{
        xtype: 'progressbar'
    }]
);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM