I'm attempting to upgrade to extjs 5 and am getting the same error. In my case though it's happening just from trying to .show() a window.
Using this code in a fresh project works fine. But I'm stumped as to how to debug this issue in my upgrade code.
Window
Code:
Ext.define('MyApp.view.loginWin', {
extend: 'Ext.window.Window',
alias: 'widget.loginWin',
requires: [
'MyApp.view.loginWinViewModel',
'Ext.form.Panel',
'Ext.form.field.Text'
],
viewModel: {
type: 'loginwin'
},
height: 250,
itemId: 'loginWin',
width: 400,
title: 'Login',
modal: true,
items: [
{
xtype: 'form',
bodyPadding: 10,
title: 'My Form',
items: [
{
xtype: 'textfield',
anchor: '100%',
itemId: 'name',
fieldLabel: 'Label'
}
]
}
]
});
Event to show window
Code:
Ext.create('widget.loginWin',{
renderTo:Ext.getBody(),
listeners:[{
afterrender:function(){
//show window
this.show();
}
}]
});
Stacktrace
Code:
Uncaught TypeError: Cannot read property 'style' of nullext-all-rtl-debug.js?_dc=1429222084984:16723
Ext.define.beforeShowext-all-rtl-debug.js?_dc=1429222084984:16536
Ext.define.showext-all-rtl-debug.js?_dc=1429222084984:22429
setUnderlaysVisibleext-all-rtl-debug.js?_dc=1429222084984:28766
Ext.define.setVisibleext-all-rtl-debug.js?_dc=1429222084984:28825
Ext.define.showext-all-rtl-debug.js?_dc=1429222084984:40517
Ext.define.onShowext-all-rtl-debug.js?_dc=1429222084984:7378
Ext.Base.Base.addMembers.callParentext-all-rtl-debug.js?_dc=1429222084984:88940
Ext.define.onShowext-all-rtl-debug.js?_dc=1429222084984:7378
Ext.Base.Base.addMembers.callParentext-all-rtl-debug.js?_dc=1429222084984:111708
Ext.define.onShowext-all-rtl-debug.js?_dc=1429222084984:41027
Ext.define.showtoolBar.js?_dc=1429222088269:1876
Ext.create.listeners.afterrenderext-all-rtl-debug.js?_dc=1429222084984:11800
fireext-all-rtl-debug.js?_dc=1429222084984:12329
doFireEventext-all-rtl-debug.js?_dc=1429222084984:33460
prototype.doFireEventext-all-rtl-debug.js?_dc=1429222084984:12297
fireEventArgsext-all-rtl-debug.js?_dc=1429222084984:12271
fireEventext-all-rtl-debug.js?_dc=1429222084984:37148
Ext.define.privates.finishRenderext-all-rtl-debug.js?_dc=1429222084984:36924
Ext.define.renderext-all-rtl-debug.js?_dc=1429222084984:39105
Ext.define.constructorext-all-rtl-debug.js?_dc=1429222084984:7657
constructorVM1671:1 (anonymous function)
ext-all-rtl-debug.js?_dc=1429222084984:8894
Ext.ClassManager.Ext.apply.createtoolBar.js?_dc=1429222088269:1871
Ext.define.onOpenLoginext-all-rtl-debug.js?_dc=1429222084984:11800
fireext-all-rtl-debug.js?_dc=1429222084984:12329
doFireEventext-all-rtl-debug.js?_dc=1429222084984:33460
prototype.doFireEventext-all-rtl-debug.js?_dc=1429222084984:12297
fireEventArgsext-all-rtl-debug.js?_dc=1429222084984:12271
fireEventtoolBar.js?_dc=1429222088269:356
Ext.define.mainLoginBtnext-all-rtl-debug.js?_dc=1429222084984:11800
fireext-all-rtl-debug.js?_dc=1429222084984:33354
Ext.define.dispatchext-all-rtl-debug.js?_dc=1429222084984:7378
Ext.Base.Base.addMembers.callParentext-all-rtl-debug.js?_dc=1429222084984:33536
Ext.define.dispatchext-all-rtl-debug.js?_dc=1429222084984:33462
prototype.doFireEventext-all-rtl-debug.js?_dc=1429222084984:12297
fireEventArgsext-all-rtl-debug.js?_dc=1429222084984:12271
fireEventext-all-rtl-debug.js?_dc=1429222084984:108900
Ext.define.fireHandlerext-all-rtl-debug.js?_dc=1429222084984:108889
Ext.define.onClickext-all-rtl-debug.js?_dc=1429222084984:11800
fireext-all-rtl-debug.js?_dc=1429222084984:18545
Ext.define.fireext-all-rtl-debug.js?_dc=1429222084984:18521
Ext.define.publishext-all-rtl-debug.js?_dc=1429222084984:18571
Ext.define.doDelegatedEventext-all-rtl-debug.js?_dc=1429222084984:18558
Ext.define.onDelegatedEventext-all-rtl-debug.js?_dc=1429222084984:4402
Ext.Function.ExtFunction.bind.method
ExtJS error
Code:
beforeShow: function() {
var me = this,
style = me.el.dom.style, // <------- error occurs here
shim = me.shim;
if (Ext.supports.CSS3BoxShadow) {
style[me.boxShadowProperty] = '0 0 ' + (me.offset + 2) + 'px #888';
} else {
style.filter = "progid:DXImageTransform.Microsoft.alpha(opacity=" + me.opacity + ") progid:DXImageTransform.Microsoft.Blur(pixelradius=" + (me.offset) + ")";
}
if (shim) {
shim.realign();
}
},