PDA

View Full Version : remove child component bug?



dzhu
23 May 2011, 11:20 PM
Hi I have a component that displays flight legs for a flight search form.

The container will house many such 'flightLegRows' (similar to a list) like so:

[ Flight Leg Row ] [ - ] [ + ]
[ Flight Leg Row ] [ - ] [ + ]

When the [ - ] button is clicked, the row is mean to be removed completely from the container.

However, an exception is thrown: uncaught exception: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMHTMLTableCellElement.insertBefore]"
when the remove() method is called, in the scope of the container.

the js code is as follows:


_flightLegRow: function(removable) {

var flightLegInput = new xx.yy.zz.search.FlightLegInput({
columnWidth: .8
});

var legId = 'flightLeg-' + this.legs++;

var c = {

border: 0,

width: '90%',

layout: 'column',

id: legId,

items: [

flightLegInput,

{
columnWidth: .2,
margin: 10,
border: 0,
layout: {
type: 'column'
},
items: [{
xtype: 'button',
text: '-',
disabled: !removable,
listeners: {
click: Ext.Function.bind(function() {
//debugger;
this.remove(legId, true);
}, this)
}
},{
xtype: 'button',
text: '+',
listeners: {
click: Ext.Function.bind(function(){
this.add(this._flightLegRow(true));
}, this)
}
}]
}
]

};

return c;

}



Is this a bug?

Thanks

sreevalli
9 Aug 2011, 10:50 PM
Hi there,

I am getting the same error. Is this a bug? Is there any work around for this?

Thanks.

ValterBorges
22 Aug 2011, 10:10 AM
I'm getting something similar not when i remove but after i attempt to re-add a form panel.