PDA

View Full Version : Window is not opening after clicking a button



abhisekhdawn
23 Oct 2012, 10:13 PM
I have created an application where i want to pop-up a window after clicking a button, but i am getting error saying "this.container is null". Can anyone please tell me what could be the problem?
Here is the code :



Ext.application({
name: 'ODC4',
appFolder: 'app',
controllers: [],
launch: function() {
var myPanel1 = Ext.create('Ext.panel.Panel', {
itemId: 'panel1',
height: '200',
width: '400',
padding: '10 0 0 20',
items: [
{
xtype: 'textfield',
id: 'text1',
margin: '10 0 0 20'
},
{
xtype: 'button',
text: 'Click Me',
margin: '10 0 0 20',
listeners: {
'click': function(a, j, v) {
alert('clicked');
Ext.create('Ext.window.Window', {
itemId: 'win1',
title: 'Hello',
height: 200,
width: 400,
}).show();
}
}}
],
title: 'MY PANEL'
});

Ext.create('Ext.container.Viewport', {
margin: '100 0 0 200',
items: [myPanel1]
});
}
});?

scottmartin
24 Oct 2012, 6:17 AM
Please check the following using your code:
http://jsfiddle.net/aP7AD/

Scott

abhisekhdawn
24 Oct 2012, 8:24 PM
yes , it is working perfectly over there. Can you tell me what could be the issue for me (why it did not work)?

scottmartin
24 Oct 2012, 9:14 PM
Can you specify the exact version of Ext4 that you are using, OS and browser?

I simply used your code. The example is using 4.1.1

Scott.

abhisekhdawn
24 Oct 2012, 9:57 PM
i am using ExtJs 4.0.7 ,OS- windows 7 and browser - firefox 16.0.1

incase i need to update the version of the ExtJs SDK, how to do that ?

scottmartin
25 Oct 2012, 4:05 AM
i am using ExtJs 4.0.7

Please upgrade to 4.1.2+ to correct this and many other issues.

Scott.