PDA

View Full Version : FormPanel with ColumnLayout error



vahid4134
3 Feb 2010, 12:31 AM
this code return error. only in column layout



var simple = new Ext.FormPanel({
labelWidth: 75, // label settings here cascade unless overridden
url:'save-form.php',
frame:true,
title: 'Simple Form',
bodyStyle:'padding:5px 5px 0',
width: 350,
layout:"column",
defaults: {width: 230},
defaultType: 'textfield',

items: [{
fieldLabel: 'First Name',
name: 'first',
allowBlank:false
},{
fieldLabel: 'Last Name',
name: 'last'
},{
fieldLabel: 'Company',
name: 'company'
}, {
fieldLabel: 'Email',
name: 'email',
vtype:'email'
}, new Ext.form.TimeField({
fieldLabel: 'Time',
name: 'time'
})
],

buttons: [{
text: 'Save'
},{
text: 'Cancel'
}]
});
simple.render(document.body);

simple.remove(simple.items.itemAt(4),true);
simple.insert(4,new Ext.form.TextField({
fieldLabel: 'Time',
name: 'time'
}));
simple.doLayout();

simple.remove(simple.items.itemAt(4),true);
simple.insert(4,new Ext.form.TextField({
fieldLabel: 'Time',
name: 'time'
}));
simple.doLayout();

vahid4134
3 Feb 2010, 12:41 AM
Oh sorry. please fix Thread title

mitchellsimoens
3 Feb 2010, 7:55 AM
Oh sorry. please fix Thread title

You can edit the title yourself! And what is the error you are getting?

mystix
3 Feb 2010, 8:12 AM
Oh sorry. please fix Thread title

I would fix the thread title if i knew what you were reporting.
for example, what error does your code throw?

[edit]
i've renamed the thread title as best i could.
i've no idea what else to call it based on the zen-like bug report.

mitchellsimoens
3 Feb 2010, 8:59 AM
So you specify the layout to be column but you have no columns! Commenting out the layout line will give you no errors.

Start with this example and change it to fit your needs. This was the 3rd form in the sample (http://www.extjs.com/deploy/dev/examples/form/dynamic.html) provided by the Ext team. Notice that the columnWidth....


var top = new Ext.FormPanel({
labelAlign: 'top',
frame:true,
title: 'Multi Column, Nested Layouts and Anchoring',
bodyStyle:'padding:5px 5px 0',
width: 600,
items: [{
layout:'column',
items:[{
columnWidth:.5,
layout: 'form',
items: [{
xtype:'textfield',
fieldLabel: 'First Name',
name: 'first',
anchor:'95%'
}, {
xtype:'textfield',
fieldLabel: 'Company',
name: 'company',
anchor:'95%'
}]
},{
columnWidth:.5,
layout: 'form',
items: [{
xtype:'textfield',
fieldLabel: 'Last Name',
name: 'last',
anchor:'95%'
},{
xtype:'textfield',
fieldLabel: 'Email',
name: 'email',
vtype:'email',
anchor:'95%'
}]
}]
},{
xtype:'htmleditor',
id:'bio',
fieldLabel:'Biography',
height:200,
anchor:'98%'
}],

buttons: [{
text: 'Save'
},{
text: 'Cancel'
}]
});

evant
3 Feb 2010, 5:02 PM
It was actually a bug due to the layout refactoring, but it's since been corrected.

vahid4134
4 Feb 2010, 12:06 AM
Hi
Its just example
I use Ext.ux.RowEditor and change layout to column. In My app need to change one filed if user change combo.
if last component is combo and I try to change Combo box this error occurs.


b.dom is undefined
http://localhost/ext-3.1.0/ext-all.js
Line 7