Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在ExtJS中更改进度条的值_Extjs_Progress Bar - Fatal编程技术网

在ExtJS中更改进度条的值

在ExtJS中更改进度条的值,extjs,progress-bar,Extjs,Progress Bar,我试图改变ExtJS中进度条的值 我按如下方式渲染进度条: var simple = new Ext.FormPanel({ labelWidth: 75, // label settings here cascade unless overridden url:'save-form.php', frame:true, title: 'myAPI', bodyStyle:'padding:5px 5px 0',

我试图改变ExtJS中进度条的值

我按如下方式渲染进度条:

var simple = new Ext.FormPanel({
        labelWidth: 75, // label settings here cascade unless overridden
        url:'save-form.php',
        frame:true,
        title: 'myAPI',
        bodyStyle:'padding:5px 5px 0',
        width: 350,
        defaults: {width: 230},
        defaultType: 'textarea',

        items: [{
                fieldLabel: 'Record ',
                name: 'first',
                id: 'record1',
                allowBlank:false
            },{
                fieldLabel: 'Last Name',
                name: 'last'
            },{
                fieldLabel: 'Company',
                name: 'company'
            }, {
                xtype: 'dataview',
                name: 'email',
                vtype:'email'
            },{
                xtype: 'progress',
                name: 'mybar',
                id: 'mybar',
                value: bar
            }
        ],
        buttons: [{
            text: 'Start',
            handler: clicked
        },{
            text: 'Cancel'
        }]     
    });
    simple.render(document.body);
var mybar = Ext.get('mybar').updateProgress(bar);
我正在尝试更新进度条,如下所示:

var simple = new Ext.FormPanel({
        labelWidth: 75, // label settings here cascade unless overridden
        url:'save-form.php',
        frame:true,
        title: 'myAPI',
        bodyStyle:'padding:5px 5px 0',
        width: 350,
        defaults: {width: 230},
        defaultType: 'textarea',

        items: [{
                fieldLabel: 'Record ',
                name: 'first',
                id: 'record1',
                allowBlank:false
            },{
                fieldLabel: 'Last Name',
                name: 'last'
            },{
                fieldLabel: 'Company',
                name: 'company'
            }, {
                xtype: 'dataview',
                name: 'email',
                vtype:'email'
            },{
                xtype: 'progress',
                name: 'mybar',
                id: 'mybar',
                value: bar
            }
        ],
        buttons: [{
            text: 'Start',
            handler: clicked
        },{
            text: 'Cancel'
        }]     
    });
    simple.render(document.body);
var mybar = Ext.get('mybar').updateProgress(bar);
但我在chrome上看到了这个:

未捕获的TypeError:对象[Object Object]没有方法“updateProgress”

谢谢

根据文件:

get(混合el):元素 检索外部元素对象。此方法不检索组件。此方法检索外部元素对象,其中。。。 检索外部元素对象

此方法不检索组件。此方法检索封装DOM元素的Ext.Element对象。要通过组件ID检索组件,请使用Ext.ComponentMgr.get

使用简单缓存一致地返回相同的对象。自动修复通过AJAX或DOM使用相同id重新创建对象的情况

--

因此,只需使用Ext.ComponentMgr.get('mybar').updateProgress

此外,updateProgress函数定义如下:

updateProgress([Float value]、[String text]、[Boolean animate]):Ext.ProgressBar

根据文件:

get(混合el):元素 检索外部元素对象。此方法不检索组件。此方法检索外部元素对象,其中。。。 检索外部元素对象

此方法不检索组件。此方法检索封装DOM元素的Ext.Element对象。要通过组件ID检索组件,请使用Ext.ComponentMgr.get

使用简单缓存一致地返回相同的对象。自动修复通过AJAX或DOM使用相同id重新创建对象的情况

--

因此,只需使用Ext.ComponentMgr.get('mybar').updateProgress

此外,updateProgress函数定义如下:


updateProgress([Float value]、[String text]、[Boolean animate]):Ext.ProgressBar

或较短的
Ext.getCmp('mybar')
Ah,Brian-总是比我远一步:-)或较短的
Ext.getCmp('mybar')
Ah,Brian-总是比我远一步:-)