0 0

extjs allowBlank 如何临时禁用5

formPanel = new Ext.FormPanel({
             region:'center',
             layout:'column',
             autoScroll:true,
             items:[{

xtype:'textarea',
                         fieldLabel: '備註',
                         name: 'remark',
                         width: 300,
                         allowBlank: false,
                         blankText:"備註是必填項",
                          msgTarget: 'under',
}]
});

在初始化画面时
this.getForm().load({
           waitMsg: '正在加载数据',
           waitTitle: '提示',
           url: 'xxxx.action',
           method: 'GET',
           params: {purchase_order_id: xxxxx},
           success: function(form, action) { 
           },
           failure:function(form, action){
                  Ext.Msg.alert('操作',"加載資料失敗");
           }
           });
因为从后台传递过来的资料remark属性对应value==null(需要load其他属性的value), 画面此是显示红色的警示框(提示“備註是必填項”),能在load时禁用这个allowBlank ,在submit时再有效吗?或是有其他解决办法?extjs allowBlank 临时禁用

问题补充:解决办法是在
success: function(form, action) { 
               // 初始化不需要錯誤驗證
               this.getForm().clearInvalid();
},scope:this  // 注意scope
2010年3月31日 14:20

1个答案 按时间排序 按投票排序

0 0

貌似设置  el.disabled()后就会失效

2010年3月31日 14:51

相关推荐

Global site tag (gtag.js) - Google Analytics