PDA

View Full Version : [OPEN] [FIXED-238][3.0r5279] Error in FormLayout.js when a window with a FieldSet is closed



papandreou
9 Sep 2009, 5:00 AM
Hey,

This test case causes a javascript error when I upgrade to r5279. To reproduce, click the button, then close the window.



Ext.onReady(function() {
new Ext.Viewport({
items: new Ext.Button({
text: 'Click me, then close the window, and you will get a javascript error',
handler: function() {
new Ext.Window({
items: {
xtype: 'form',
items: new Ext.form.FieldSet()
}
}).show();
}
})
});
});
Best regards,
Papandreou

jay@moduscreate.com
9 Sep 2009, 5:44 AM
Confirmed, though you can easily paste this:

new Ext.Window({
items: {
xtype: 'form',
items: new Ext.form.FieldSet()
}
}).show();

ivaylo.bakalov
9 Sep 2009, 6:08 AM
Here is a quick fix. Change two lines in Ext.layout.FormLayout.onRemove:

Line 1 from
ct = c.getItemCt();to
ct = c.getItemCt && c.getItemCt();

Line 2 from
el.insertAfter(ct);to
ct.parentNode && el.insertAfter(ct);

papandreou
9 Sep 2009, 6:30 AM
Here is a quick fix. Change the line in Ext.layout.FormLayout.onRemove

Thanks, that will have to work for now :)

Best regards,
Papandreou

evant
10 Sep 2009, 5:00 PM
Fix applied to svn in rev #5328 for patch release 3.0.2.

ivaylo.bakalov
11 Sep 2009, 5:51 AM
Unfortunately, you have to apply the fix from line two as well. Here is a test case:



Ext.onReady(
function()
{
new Ext.Window({
items: {
xtype: 'form',
items: new Ext.form.CheckboxGroup({items: [{ boxLabel: 'Item 1', name: 'cb-col-1' }]})
}
}).show().close();
});


Here is a quick fix. Change two lines in Ext.layout.FormLayout.onRemove:

Line 1 from
ct = c.getItemCt();to
ct = c.getItemCt && c.getItemCt();

Line 2 from
el.insertAfter(ct);to
ct.parentNode && el.insertAfter(ct);