PDA

View Full Version : Window preventHeader bug



b.jones
30 May 2012, 7:30 AM
Creating a new window with 'preventHeader: true ' throws the error: Uncaught TypeError: Cannot call method 'query' of undefined.

It looks like this because the ghostTools is undefined as a header has not been created.

I'm trying to create a square window that has no header, close button and is not draggable if anyone can suggest an alternative method?

Thanks

skirtle
31 May 2012, 2:06 PM
Which ExtJS version?

Have you tried just turning off the bits you don't need?


closable: false,
draggable: false

Works for me.

b.jones
7 Jun 2012, 12:39 AM
Hi Skirtle,

I am using version 4.1 and have already set those parameters. this is the configuration I am using:

draggable: false, frame: true,
height: 500,
maxHeight: 500,
maxWidth: 840,
minHeight: 500,
minWidth: 840,
width: 840,
shadow: 'frame',
resizable: false,
bodyBorder: true,
closable: false,
closeAction: 'hide',
collapsed: false,
title: 'test',
modal: true,
plain: false,

Any other ideas?

skirtle
7 Jun 2012, 12:49 AM
You need to remove the title too.

I wouldn't use frame on a window either if I were you.

b.jones
7 Jun 2012, 12:59 AM
I have removed both of those settings so now have:



draggable: false, height: 500,
maxHeight: 500,
maxWidth: 840,
minHeight: 500,
minWidth: 840,
width: 840,
shadow: 'frame',
resizable: false,
bodyBorder: true,
closable: false,
closeAction: 'hide',
collapsed: false,
modal: true,
plain: false,

But the error still occurs. If I make the window closable then it works but I don't need the close button or header area of the window. Are you able recreate this?

netemp
7 Jun 2012, 1:02 AM
As Skirtle shared, you need to remove 'title' too. Also, preventHeader seems to be no more existing in version 4.1. And now we need to use - 'header' config for it.

More details at these links:

http://www.sencha.com/forum/showthread.php?205812-No-preventHeader-for-window-in-4.1-version

http://docs.sencha.com/ext-js/4-1/#!/api/Ext.panel.Panel-cfg-preventHeader

http://docs.sencha.com/ext-js/4-1/#!/api/Ext.panel.Panel-cfg-header

Hope this helps.

b.jones
7 Jun 2012, 1:40 AM
I've tried your suggestions to no avail:


draggable: false, height: 500,
maxHeight: 500,
maxWidth: 840,
minHeight: 500,
minWidth: 840,
width: 840,
shadow: 'frame',
resizable: false,
bodyBorder: true,
closable: false,
closeAction: 'hide',
collapsed: false,
modal: true,
plain: false,
header: false,

netemp
7 Jun 2012, 1:52 AM
I used the code you posted as following:



Ext.onReady(function() {
var win = Ext.create('Ext.window.Window', {
header:false,
draggable: false,
frame: true,
height: 500,
maxHeight: 500,
maxWidth: 840,
minHeight: 500,
minWidth: 840,
width: 840,
shadow: 'frame',
resizable: false,
bodyBorder: true,
closable: false,
closeAction: 'hide',
collapsed: false,
title: 'test',
modal: true,
plain: false,
html:'Test'
});
win.show();
});


and this displayed the window as shown in the screenshot below.

Thus, there seems to be something wrong with your some other part of the code.

36033

b.jones
7 Jun 2012, 1:53 AM
OK thanks I will keep digging. I am using Sencha Architect so may be an issue with that.