代码报错:
1、对象不支持此属性或方法
2、this.form.el.dom为空或不是对象
情况紧急,麻烦高手解决一下,最好把源码贴出来哈 ,本人倾家荡产就20分,全压上了!!!
ModifyUserForm = function(config){
var loginTypeStore = new Ext.data.Store( {
url : loginTypePath,
reader : new Ext.data.JsonReader( {
root : 'item',
id : 'id'
}, ['id', 'value'])
});
var isLoginStore = new Ext.data.Store( {
url : isLoginPath,
reader : new Ext.data.JsonReader( {
root : 'item',
id : 'id'
}, ['id', 'value'])
});
var jgmStore = new Ext.data.Store({
url: jgmPath,
reader: new Ext.data.JsonReader({
root: 'item',
id: 'id'
}, ['id','value'])
});
var userStatusStore = new Ext.data.Store({
url: userStatusPath,
reader: new Ext.data.JsonReader({
root: 'item',
id: 'id'
}, ['id','value'])
});
loginTypeStore.load();
jgmStore.load();
isLoginStore.load();
userStatusStore.load();
ModifyUserForm.superclass.constructor.call(this,{
reader: new Ext.data.XmlReader({
success: '@success',
record: 'row'
}, [
'F_USERID','F_CNNAME','F_DEPTID','F_PASSWORD','F_FLAG','F_NET_IP','F_LOGIN_TYPE','F_PORT','F_PASSWORD_DATE','F_MOBILE','F_EMAIL','F_MEMO','F_USER_STATUS'
]),
errorReader: new Ext.data.XmlReader({
success: '@success',
record: 'field'
}, [
'id','msg',
]),
labelWidth: 105,
//labelAlign: 'top',
loadMask: 'loading.....',
frame:true,
title: '',
border : false,
bodyStyle:'padding:0px 0px 0',
items: [{
layout:'column',
items:[{
columnWidth:.50,
layout: 'form',
items: [{
xtype:'textfield',
fieldLabel: '用户ID',
labelSeparator:' ',
name: 'F_USERID',
id:'userId',
allowBlank:false,
readOnly:true,
tabIndex:1,
//regex:/^[0-9]{6}$/,
//regexText:'must 6 digits!!',
anchor:'90%'
}, {
xtype:'textfield',
allowBlank:false,
fieldLabel: '中文名',
name: 'F_CNNAME',
//regex:/^[A-Z]{3}$/,
regexText:'must 3 letter!!',
labelSeparator:' ',
id:'cnnameId',
anchor:'90%'
},{
xtype:'combo',
store: jgmStore,
name:'F_DEPTID',
hiddenName:'F_DEPTID',
displayField:'value',
valueField :'id',
fieldLabel:'所属机构',
mode:'local',
labelSeparator:' ',
typeAhead: true,
allowBlank:false,
triggerAction: 'all',
emptyText:'请选择一个机构',
selectOnFocus:true,
editable : false,
anchor:'90%'
},{
xtype:'textfield',
fieldLabel: '机器IP地址',
name: 'F_NET_IP',
id:'netIpId',
readOnly:false,
allowBlank:false,
labelSeparator:' ',
anchor:'90%'
},{
xtype:'textfield',
fieldLabel: '机器端口',
name: 'F_PORT',
id:'portId',
readOnly:false,
allowBlank:false,
labelSeparator:' ',
anchor:'90%'
},{
xtype:'combo',
store: loginTypeStore,
name:'F_LOGIN_TYPE',
hiddenName:'F_LOGIN_TYPE',
displayField:'value',
valueField :'id',
mode:'local',
fieldLabel:'登录方式',
labelSeparator:' ',
typeAhead: true,
allowBlank:false,
triggerAction: 'all',
emptyText:'请选择登录方式',
selectOnFocus:true,
editable : false,
anchor:'90%'
},{
xtype:'combo',
store: isLoginStore,
valueField :'id',
displayField: 'value',
emptyText:'是否允许登录',
hiddenName:'F_FLAG',
typeAhead: true,
allowBlank:false,
mode:'local',
editable:false,
triggerAction: 'all',
fieldLabel: '登录状态',
name:'F_FLAG',
id : 'isLoginId',
labelSeparator:' ',
selectOnFocus:true,
anchor:'90%'
},{
xtype:'combo',
store: userStatusStore,
valueField :'id',
displayField: 'value',
emptyText:'请选择用户状态',
hiddenName:'F_USER_STATUS',
typeAhead: true,
allowBlank:false,
mode:'local',
editable:false,
triggerAction: 'all',
fieldLabel: '用户状态',
name:'F_USER_STATUS',
id : 'userStatusId',
labelSeparator:' ',
selectOnFocus:true,
anchor:'90%'
},{
xtype:'textfield',
fieldLabel: '手机号码',
name: 'F_MOBILE',
id:'mobileId',
readOnly:false,
//allowBlank:false,
labelSeparator:' ',
anchor:'90%'
},{
xtype:'textfield',
fieldLabel: '邮箱',
name: 'F_EMAIL',
id:'emailId',
readOnly:false,
//allowBlank:false,
labelSeparator:' ',
anchor:'90%'
},{
xtype:'textarea',
fieldLabel: '备注',
name: 'F_MEMO',
id:'memoId',
readOnly:false,
labelSeparator:' ',
anchor : '90%',
growMax : 2,
height : 80,
growMin : 2
}]
}]
},
new Ext.form.DateField({
fieldLabel: '密码到期日期',
allowBlank:false,
format:'Y-m-d',
labelSeparator:' ',
emptyText:'请选择密码到期日期',
name: 'F_PASSWORD_DATE',
id:'datetime',
tabIndex:8,
anchor:'25%'
}),{
xtype:'textfield',
hidden:true,
fieldLabel: '',
labelSeparator:'',
name: 'result',
id:'resultId'
}]
});
this.doSubmit = doSubmit;
function doSubmit(){
var dataUrl = uniDataPath + '?act=ModifyUser';
this.form.submit({url:dataUrl , waitMsg:'保存数据....'});
}
}Ext.extend(ModifyUserForm, Ext.FormPanel);
Ext.onReady(function(){
var bottomNavigation = new Ext.Toolbar({
el:'south',
region:'south',
layout:'fit',
items:[{
text: '保存',
id: 'generateBtn',
name: 'generateBtn',
handler:function(){
modifyUserForm.doSubmit();
}
},'-',{
text: '返回',
handler:function(){
location.href='control.action?module=admin/userManager.jsp';
}
}]
})
var modifyUserForm = new ModifyUserForm();
modifyUserForm.form.on({
actioncomplete: function(form, action){
if(action.type == 'submit'){
Ext.MessageBox.show({
title: '用户维护',
msg: '保存成功!',// TODO 文字
width:300,
buttons: Ext.MessageBox.OK,
icon: Ext.MessageBox.INFO,
fn:function(btn,text){
if(btn == 'ok'){
location.href='control.action?module=admin/userManager.jsp';
}
}
});
}
}
});modifyUserForm.form.load({url:formPath , waitMsg:'Loading'});
var mainCenter = new Ext.Panel({
layout: 'fit',
el:'center',
border : false,
region:'center',
items:modifyUserForm
})
var viewport = new Ext.Viewport({
layout:'border',
items:[
mainCenter,bottomNavigation
]
});
});
1、对象不支持此属性或方法
2、this.form.el.dom为空或不是对象
情况紧急,麻烦高手解决一下,最好把源码贴出来哈 ,本人倾家荡产就20分,全压上了!!!
ModifyUserForm = function(config){
var loginTypeStore = new Ext.data.Store( {
url : loginTypePath,
reader : new Ext.data.JsonReader( {
root : 'item',
id : 'id'
}, ['id', 'value'])
});
var isLoginStore = new Ext.data.Store( {
url : isLoginPath,
reader : new Ext.data.JsonReader( {
root : 'item',
id : 'id'
}, ['id', 'value'])
});
var jgmStore = new Ext.data.Store({
url: jgmPath,
reader: new Ext.data.JsonReader({
root: 'item',
id: 'id'
}, ['id','value'])
});
var userStatusStore = new Ext.data.Store({
url: userStatusPath,
reader: new Ext.data.JsonReader({
root: 'item',
id: 'id'
}, ['id','value'])
});
loginTypeStore.load();
jgmStore.load();
isLoginStore.load();
userStatusStore.load();
ModifyUserForm.superclass.constructor.call(this,{
reader: new Ext.data.XmlReader({
success: '@success',
record: 'row'
}, [
'F_USERID','F_CNNAME','F_DEPTID','F_PASSWORD','F_FLAG','F_NET_IP','F_LOGIN_TYPE','F_PORT','F_PASSWORD_DATE','F_MOBILE','F_EMAIL','F_MEMO','F_USER_STATUS'
]),
errorReader: new Ext.data.XmlReader({
success: '@success',
record: 'field'
}, [
'id','msg',
]),
labelWidth: 105,
//labelAlign: 'top',
loadMask: 'loading.....',
frame:true,
title: '',
border : false,
bodyStyle:'padding:0px 0px 0',
items: [{
layout:'column',
items:[{
columnWidth:.50,
layout: 'form',
items: [{
xtype:'textfield',
fieldLabel: '用户ID',
labelSeparator:' ',
name: 'F_USERID',
id:'userId',
allowBlank:false,
readOnly:true,
tabIndex:1,
//regex:/^[0-9]{6}$/,
//regexText:'must 6 digits!!',
anchor:'90%'
}, {
xtype:'textfield',
allowBlank:false,
fieldLabel: '中文名',
name: 'F_CNNAME',
//regex:/^[A-Z]{3}$/,
regexText:'must 3 letter!!',
labelSeparator:' ',
id:'cnnameId',
anchor:'90%'
},{
xtype:'combo',
store: jgmStore,
name:'F_DEPTID',
hiddenName:'F_DEPTID',
displayField:'value',
valueField :'id',
fieldLabel:'所属机构',
mode:'local',
labelSeparator:' ',
typeAhead: true,
allowBlank:false,
triggerAction: 'all',
emptyText:'请选择一个机构',
selectOnFocus:true,
editable : false,
anchor:'90%'
},{
xtype:'textfield',
fieldLabel: '机器IP地址',
name: 'F_NET_IP',
id:'netIpId',
readOnly:false,
allowBlank:false,
labelSeparator:' ',
anchor:'90%'
},{
xtype:'textfield',
fieldLabel: '机器端口',
name: 'F_PORT',
id:'portId',
readOnly:false,
allowBlank:false,
labelSeparator:' ',
anchor:'90%'
},{
xtype:'combo',
store: loginTypeStore,
name:'F_LOGIN_TYPE',
hiddenName:'F_LOGIN_TYPE',
displayField:'value',
valueField :'id',
mode:'local',
fieldLabel:'登录方式',
labelSeparator:' ',
typeAhead: true,
allowBlank:false,
triggerAction: 'all',
emptyText:'请选择登录方式',
selectOnFocus:true,
editable : false,
anchor:'90%'
},{
xtype:'combo',
store: isLoginStore,
valueField :'id',
displayField: 'value',
emptyText:'是否允许登录',
hiddenName:'F_FLAG',
typeAhead: true,
allowBlank:false,
mode:'local',
editable:false,
triggerAction: 'all',
fieldLabel: '登录状态',
name:'F_FLAG',
id : 'isLoginId',
labelSeparator:' ',
selectOnFocus:true,
anchor:'90%'
},{
xtype:'combo',
store: userStatusStore,
valueField :'id',
displayField: 'value',
emptyText:'请选择用户状态',
hiddenName:'F_USER_STATUS',
typeAhead: true,
allowBlank:false,
mode:'local',
editable:false,
triggerAction: 'all',
fieldLabel: '用户状态',
name:'F_USER_STATUS',
id : 'userStatusId',
labelSeparator:' ',
selectOnFocus:true,
anchor:'90%'
},{
xtype:'textfield',
fieldLabel: '手机号码',
name: 'F_MOBILE',
id:'mobileId',
readOnly:false,
//allowBlank:false,
labelSeparator:' ',
anchor:'90%'
},{
xtype:'textfield',
fieldLabel: '邮箱',
name: 'F_EMAIL',
id:'emailId',
readOnly:false,
//allowBlank:false,
labelSeparator:' ',
anchor:'90%'
},{
xtype:'textarea',
fieldLabel: '备注',
name: 'F_MEMO',
id:'memoId',
readOnly:false,
labelSeparator:' ',
anchor : '90%',
growMax : 2,
height : 80,
growMin : 2
}]
}]
},
new Ext.form.DateField({
fieldLabel: '密码到期日期',
allowBlank:false,
format:'Y-m-d',
labelSeparator:' ',
emptyText:'请选择密码到期日期',
name: 'F_PASSWORD_DATE',
id:'datetime',
tabIndex:8,
anchor:'25%'
}),{
xtype:'textfield',
hidden:true,
fieldLabel: '',
labelSeparator:'',
name: 'result',
id:'resultId'
}]
});
this.doSubmit = doSubmit;
function doSubmit(){
var dataUrl = uniDataPath + '?act=ModifyUser';
this.form.submit({url:dataUrl , waitMsg:'保存数据....'});
}
}Ext.extend(ModifyUserForm, Ext.FormPanel);
Ext.onReady(function(){
var bottomNavigation = new Ext.Toolbar({
el:'south',
region:'south',
layout:'fit',
items:[{
text: '保存',
id: 'generateBtn',
name: 'generateBtn',
handler:function(){
modifyUserForm.doSubmit();
}
},'-',{
text: '返回',
handler:function(){
location.href='control.action?module=admin/userManager.jsp';
}
}]
})
var modifyUserForm = new ModifyUserForm();
modifyUserForm.form.on({
actioncomplete: function(form, action){
if(action.type == 'submit'){
Ext.MessageBox.show({
title: '用户维护',
msg: '保存成功!',// TODO 文字
width:300,
buttons: Ext.MessageBox.OK,
icon: Ext.MessageBox.INFO,
fn:function(btn,text){
if(btn == 'ok'){
location.href='control.action?module=admin/userManager.jsp';
}
}
});
}
}
});modifyUserForm.form.load({url:formPath , waitMsg:'Loading'});
var mainCenter = new Ext.Panel({
layout: 'fit',
el:'center',
border : false,
region:'center',
items:modifyUserForm
})
var viewport = new Ext.Viewport({
layout:'border',
items:[
mainCenter,bottomNavigation
]
});
});
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货