PDA

View Full Version : Solved - Get Content Panel in Default Layout


jaewing
08-21-2007, 08:58 AM
Sorry to ask such a silly question.:-/

Im trying to get the center panel to set it to open a page OR form instead of a view.

I have been reading (probably) every post in the forum, looking through the documentation and examples. I have tried creating my own borderlayout, with all sorts of mess. I have given up and now Im just trying to get the default center panel that gets created from the Ext.nd.DominoUI so I can set it to open something other than a view. (If I could get it to open the first doc in a view that could work too..)

If I try to create a new content panel I get an InsertAdjacentHTML error, and yes Ive read the forum posts on that too. There is a lot that is over my head.

I just want to know where to go from here:


var DemoApp = function() {
return {

init : function(){
this.ui = new Ext.nd.DominoUI({
uiOutline : {outlineName: "webMain"},
uiView : {viewName: "", viewTitle: ""},

center : {
titlebar : true,
tabPosition : 'top',
closeOnTab : true,
initialSize : 400,
autoScroll : true
}

});

} // init
} // return
}();
Ext.onReady(DemoApp.init, DemoApp, true);

RWaters
08-21-2007, 10:57 AM
DominoUI stores a reference to the BorderLayout it creates.

You could grab the LayoutRegion like so

var center = DemoApp.ui.layout.getRegion("center");


or if you're just looking to add another ContentPanel

DemoApp.ui.layout.add("center", new Ext.ContentPanel("some div", { config stuff }));

jaewing
08-21-2007, 01:31 PM
Ive been playing around with the different options, I dont get any errors, but the contents not loading either.



var DemoApp = function() {
return {
init : function(){
this.ui = new Ext.nd.DominoUI({
uiOutline : {outlineName: "webMain"},
uiView : {viewName: "", viewTitle: ""}
});

var center = DemoApp.ui.layout.getRegion("center");
var centerPanel = center.getPanel('extnd-view');
centerPanel.setUrl('/start.html?OpenPage');
centerPanel.refresh()


} // init
} // return
}();
Ext.onReady(DemoApp.init, DemoApp, true);

RWaters
08-21-2007, 01:35 PM
Oh, you're trying to do it within the init call. From there, you probably can't access DemoApp.

try this:

var center = this.ui.layout.getRegion("center");

jaewing
08-21-2007, 01:41 PM
Same Result. No Errors, No content in centerpanel
***************************************


var center = this.ui.layout.getRegion("center");
var centerPanel = center.getPanel('extnd-view'); // is this right? from dominoUI.js
centerPanel.setUrl('/start.html?OpenPage');
centerPanel.refresh()

jaewing
08-21-2007, 02:39 PM
Thanks Rich!! I did get it to work. I had to switch to ".load", I still dont understand why setUrl didnt work.
Its much appreciated, I was going to pack it in, you will laugh to know that I have been trying to do this for two weeks.. =)..Happy Dance...


var center = this.ui.layout.getRegion("center");
var centerPanel = center.getPanel('extnd-view');
centerPanel.load({ url: 'Web-Tips?OpenPage'});
centerPanel.refresh();