Add progressbar inside Ext.window

人盡茶涼 提交于 2020-05-09 10:55:33

问题


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();

回答1:


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'
    }]
);


来源:https://stackoverflow.com/questions/61092980/add-progressbar-inside-ext-window

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!