PDA

View Full Version : Problem : Node cannot be inserted at the specified point in the hierarchy



ksachdeva
5 Jun 2007, 12:57 PM
Node cannot be inserted at the specified point in the hierarchy" code: "3
this.bodyEl.dom.appendChild(panel.getEl().dom);

Above is an error shown by firebug.

Here is what I am doing:


var dlg = new Ext.LayoutDialog(config.id || Ext.id(), {
autoCreate : true,
minWidth:400,
minHeight:300,
shadow:true,
fixedcenter:true,
center:{
autoScroll:false
},
closable : false,
draggable : false,
collapsible : false,
resizable : false,
east:{
split:true,
initialSize:150,
minSize:150,
maxSize:250
}
});

var innerLayout = new Ext.BorderLayout(dlg.getEl(), {
autoCreate:true,
north: {
initialSize: 200,
autoScroll:true,
split:true
},
center: {
autoScroll:true
}
});
innerLayout.beginUpdate();
innerLayout.add("north", new Ext.ContentPanel("dl-details",{autoCreate:true}));
innerLayout.add("center", new Ext.ContentPanel("selection-panel",{autoCreate:true}));
innerLayout.endUpdate(true);

var vp = layout.add('center', new Ext.ContentPanel(Ext.id(), {
autoCreate : true,
toolbar: this.tb,
fitToFrame:true
}));


// EXECUTION OF THIS LINE GIVES AN ERROR
var dp = layout.add('east',new Ext.NestedLayoutPanel(innerLayout,{
autoCreate:true
}));


layout.endUpdate();

It is to some extent similar to Layoutdialog example that comes with the extjs but I am trying to add two panels in the "east" region.

Would really appreciate if you somebody could point out what I am doing wrong. Please note that I am creating the dialog and its contents using the script and hence autoCreate.

Regards & thanks
Kapil

tryanDLS
5 Jun 2007, 1:47 PM
Don't pass autoCreate:true to the NestedPanel ctor - that config should be something like a title - the container already exists.

ksachdeva
5 Jun 2007, 1:50 PM
Tried it, does not help.

Please note that I am using 1.0.1a. Although the response is same in 1.0 also

Regards
Kapil

tryanDLS
5 Jun 2007, 2:32 PM
Look at the layout dialog example - I don't think you want to render the borderLayout to dlg.getEl() - that's gonna step on the entire dialog.

ksachdeva
5 Jun 2007, 2:56 PM
I was not doing it earlier, for bordelayout I specified "innerdialog" as the element and used the autoCreate : true and the error I get (in firebug) is:

this.el has no properties
LayoutManager("innerdialog", Object autoCreate=true north=Object center=Object)ext-all-debug.js (line 22362)
BorderLayout("innerdialog", Object autoCreate=true north=Object center=Object)ext-all-debug.js (line 22454)
MyAppManager(Object width=750 height=400 myobj=Object)myapp.js (line 83)
(no name)()myapp.html (line 34)
fire()ext-all-debug.js (line 1426)
fireDocReady()