ExtJS Window嵌入FormPanel,多次调用报错问题
来源:互联网 发布:nginx 表达式 编辑:程序博客网 时间:2024/05/23 11:34
原始代码:
Ext.define('Gigi.view.user.EditForm', {extend : 'Ext.form.Panel',alias : 'widget.userform',frame : true,bodyPadding : 5,layout: 'anchor',defaults: {labelAlign : 'right',labelWidth : 70,anchor: '100%'},items : [ {xtype : 'textfield',name : 'username',fieldLabel : '用户名',allowBlank: false}, {xtype : 'radiogroup',fieldLabel : '启用',name : 'rgEnabled',items: [{ boxLabel: '是', name: 'enabled', inputValue: 'true', checked : true},{ boxLabel: '否', name: 'enabled', inputValue: 'false'}]}, {xtype : 'radiogroup',fieldLabel : '账号锁定',name : 'rgAccountNonLocked',items: [{ boxLabel: '是', name: 'accountNonLocked', inputValue: 'false' },{ boxLabel: '否', name: 'accountNonLocked', inputValue: 'true', checked : true}]}, {xtype : 'radiogroup',fieldLabel : '账号过期',name : 'rgAccountNonExpired',items: [{ boxLabel: '是', name: 'accountNonExpired', inputValue: 'false' },{ boxLabel: '否', name: 'accountNonExpired', inputValue: 'true', checked : true}]}, {xtype : 'radiogroup',fieldLabel : '密码过期',name : 'rgCredentialsNonExpired',items: [{ boxLabel: '是', name: 'credentialsNonExpired', inputValue: 'false' },{ boxLabel: '否', name: 'credentialsNonExpired', inputValue: 'true', checked : true}]}, {xtype : 'textfield',name : 'email',fieldLabel : 'Email'} ],loadRecord : function(record) {this.callParent(arguments);var rgEnabled = this.down('[name=rgEnabled]');rgEnabled.setValue({enabled : record.get('enabled').toString()});var rgAccountNonLocked = this.down('[name=rgAccountNonLocked]');rgAccountNonLocked.setValue({accountNonLocked : record.get('accountNonLocked').toString()});var rgAccountNonExpired = this.down('[name=rgAccountNonExpired]');rgAccountNonExpired.setValue({accountNonExpired : record.get('accountNonExpired').toString()});var rgCredentialsNonExpired = this.down('[name=rgCredentialsNonExpired]');rgCredentialsNonExpired.setValue({credentialsNonExpired : record.get('credentialsNonExpired').toString()});},initComponent : function() {if (this.initialConfig && ('update' == this.initialConfig.actionType)) {this.items[0].readOnly = true;} else {this.items[0].readOnly = false;}this.callParent(arguments);}});Ext.define('Gigi.view.user.Edit', {extend : 'Ext.window.Window',alias : 'widget.useredit',layout : 'fit',autoShow : true,actionType : 'create',items : [Ext.widget('userform', {actionType : this.actionType})],initComponent : function() {this.buttons = [ {text : '保存',action : 'save'}, {text : '取消',scope : this,handler : this.close} ];this.callParent(arguments);}});
Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMHTMLDivElement.insertBefore]
解决方法,修改Gigi.view.user.Edit,将form的构建放入initComponent方法中,而不是通过config方式声明,代码如下:
Ext.define('Gigi.view.user.Edit', {extend : 'Ext.window.Window',alias : 'widget.useredit',layout : 'fit',autoShow : true,actionType : 'create',initComponent : function() {var form = Ext.widget('userform', {actionType : this.actionType});this.items = [form];this.buttons = [ {text : '保存',action : 'save'}, {text : '取消',scope : this,handler : this.close} ];this.callParent(arguments);}});
- ExtJS Window嵌入FormPanel,多次调用报错问题
- ext使用问题二:把formpanel嵌入window中
- ExtJS中FormPanel的labelWidth问题
- ExtJS中FormPanel的labelWidth问题
- IE9中调用window.performance.now()报错的问题
- ExtJs技巧 FormPanel.getForm().getValues()的键名问题.
- ExtJs技巧 FormPanel.getForm().getValues()的键名问题.
- Proxool多次调用打开连接报错记录
- ExtJS专题-FormPanel(1)
- ExtJS专题-FormPanel(1)
- extjs FormPanel不可编辑
- ExtJs—FormPanel居中
- ExtJs之FormPanel篇
- ExtJS专题-FormPanel(1) .
- ExtJs FormPanel 表单布局
- ExtJs formPanel(一、基础)
- ExtJs-05-FormPanel
- ExtJS(4)--Ext.FormPanel
- Objective-C数量类型-Objective-C 限定词 long short 等
- COM笔记-引用计数
- 作为一个菜鸟程序员就想说的
- 系统架构
- Objective-C数量类型-Objective-C id 数据类型
- ExtJS Window嵌入FormPanel,多次调用报错问题
- 求一个数的立方的新方法
- Remove PC Security 2011
- vi替换字符串
- Android2.2 API 中文文档系列(1) —— TextView
- Linux GCC内嵌汇编基础知识
- Magento 输出SQL语句用于调试
- 数据库理论
- 希尔排序