日期:2014-05-16  浏览次数:20624 次

ExtJS4.x设置表单中控件为可用
整体代码如下所示,窗体加载的时候,4个文本框是不可用的,点击保存按钮后获得窗体4个文本框可进行编辑,现在我通过下边这句获得到了窗体中4个文本框控件

var formT = this.up('form').query('textfield');

获得后进行循环,forEach如何能让formT进行单一循环

Ext.Array.forEach(formT, function(field) {
   然后在这里对获得到的那个textfield控件进行可用设置
}


Ext.onReady(function(){
           var formPanel;
            formPanel = Ext.widget('form', {
                renderTo: Ext.getBody(),
                title: 'Complete Check Out',
                frame: true,
                width: 550,
                bodyPadding: 5,
                fieldDefaults: {
                    labelAlign: 'right',
                    labelWidth: 90,
                    msgTarget: 'qtip'
                },
                items: [
                    // Billing Address
                    {
                        xtype: 'fieldset',
                        title: 'Billing Address',
                        layout: 'anchor',
                        defaults: {
                            anchor: '100%'
                        },
                        items: [{
                            xtype: 'checkbox',