PDA

View Full Version : xtype and window



dirkpitt_10
10 Jun 2009, 3:35 AM
Hi, i have a problem to put my xtype in a Ext.Window, so this is my code:



Ext.ux.SearchWindow = Ext.extend(Ext.Panel, {
autoEl: '<div>',
onRender: function(ct, position) {
Ext.ux.SearchWindow.superclass.onRender.call(this, ct, position);

var box = new Ext.form.FormPanel({ // raw
region:'north',
layout:'form',
height:32,
items:[{
xtype: 'textfield'
}]
});
var tabs = new Ext.TabPanel({
region: 'center',
margins:'3 3 3 0',
width: 400,
activeTab: 0,
defaults:{autoScroll:true},

items:[{
title: 'Search1',
html: Ext.example.bogusMarkup,
closable:true
},{
title: 'Search2',
html: Ext.example.bogusMarkup,
closable:true
},{
title: 'Search3',
html: Ext.example.bogusMarkup,
closable:true
}]
});

// Panel for the west
var nav = new Ext.Panel({
title: 'Navigation',
region: 'west',
split: true,
width: 200,
collapsible: true,
margins:'3 0 3 3',
cmargins:'3 3 3 3'
});


var pane = new Ext.Panel({
renderTo: this.el,
closable:true,
width:700,
height:800,
layout: 'border',
items: [nav, tabs, box]
});


}
});

Ext.ComponentMgr.registerType('searchwindow', Ext.ux.SearchWindow);



and this is the window use xtype:



var wind = new Ext.Window({
title: 'Layout Window',
closable:true,
width:600,
height:500,
layout: 'fit',
items: [{
xtype: 'searchwindow'
}]
});


this does not work, the window would appear without panel but when i delete the attribute "height" of "element.style" with Firebug panel appears properly...

Any suggestion?

Best regards

Stefano

dirkpitt_10
10 Jun 2009, 3:50 AM
The problem it was that I have not added "pane" to "SearchWindow" xtype, so in the window was inserted an empty panel and after the panel that i want to insert. So in this way:



Ext.ux.SearchWindow = Ext.extend(Ext.Panel, {
..............
..............

//this is missing line of code
this.add(pane);

});



work it...

Thanks

Animal
10 Jun 2009, 3:56 AM
still overnested