PDA

View Full Version : Desktop and windows with border layout



jmesquita
28 Jan 2010, 11:05 PM
Gentleman,

This is my first post and I am new to both JS and Ext so please bear with me. I am a fast learner and I never hesitate to read documentation or code/re-code, etc...

I am trying to modify the ExtTop example by adding windows with the border layout. Drawing the window and it is built for the first time works perfectly but something goes wrong while closing it (which I believe destroys it) and trying to re-open it.

The code that I am trying is the exact same ExtTop code found on Ext 3.1.0 with the following modifications:



/*
* Example windows
*/

var one = new Ext.Panel({
region: 'west',
html: '<p>test 1</p>'
});

var other = new Ext.Panel({
region: 'center',
html: '<p>test 2</p>'
});

MyDesktop.GridWindow = Ext.extend(Ext.app.Module, {
id:'grid-win',
init : function(){
this.launcher = {
text: 'Grid Window',
iconCls:'icon-grid',
handler : this.createWindow,
scope: this
};
},

createWindow : function(){
var desktop = this.app.getDesktop();
var win = desktop.getWindow('grid-win');
if(!win){
win = desktop.createWindow({
id: 'grid-win',
title:'Grid Window',
width:740,
height:480,
iconCls: 'icon-grid',
shim:false,
animCollapse:false,
constrainHeader:true,

layout: 'border',
items: [one, other]
});
}
win.show();
}
});
The error reported by Firebug is as follows:


dom is undefined
file:///Users/jmesquita/Downloads/ext-3.1.0/ext-all-debug.js
Line 4045Any help or hint is much appreciated.

Regards,

Joćo Mesquita