PDA

View Full Version : this[a] is null when trying to modify form dynamically



ozgur
8 Jun 2010, 1:19 AM
Hello,

My version of ExtJS is 3.1.0 and I'm working on Mac OS 10.6.3.

In my project I'm trying to modify a form part dynamically on user actions...

When testing on Firefox (version 3.6.3) I encoutered this error -> "this[a] is null" ...

The error disappears when I include ext-all-debug.js . ( the problem is that I don't want to load this huge script everytime )...

Code part called for doing modification on the form :



var form = new Ext.FormPanel({
applyTo : 'target',
width : 500,
height : 40,
layout : {
type: 'hbox',
align : 'stretch',
pack : 'start'
},
autoScroll : true,
labelWidth : 50,
flex : 1,
defaults : {
msgTarget : 'side'
},
bodyStyle : 'padding: 5px',
border : false,
items : [
new Ext.Panel({
layout :'form',
autoScroll : true,
labelWidth : 50,
flex : 1,
defaults : {
msgTarget : 'side'
},
bodyStyle : 'padding: 5px',
border : false,
items : [
new Ext.form.DateField ({
id: 'from',
fieldLabel:'From',
name: 'display',
msgTarget:'qtip'
})
]
}),
new Ext.Panel({
layout:'form',
autoScroll : true,
labelWidth : 50,
flex : 1,
defaults : {
msgTarget : 'side'
},
bodyStyle : 'padding: 5px',
border : false,
items : [
new Ext.form.DateField ({
id: 'to',
fieldLabel:'To',
name: 'display',
msgTarget:'qtip'
})
]
})
]
});
Thanks for help,

Ozgür.

ozgur
8 Jun 2010, 6:57 AM
Problem resolved by using Ext.Panel and setting the layout to form...

I don't understand why it didn't work in previous version... strange...



new Ext.Panel({
...
layout:'form',
...
});

Condor
8 Jun 2010, 7:03 AM
You probably had this error because you tried to render a <form> inside a <form>.

ozgur
8 Jun 2010, 7:18 AM
Indeed, the problem was due to this...

Condor thank you for given attention to this thread, you have clarified my ideas...

Ozgür.