0
votes

I am getting the error:

Uncaught TypeError: Cannot read property 'addCls' of null

for the following Scenario

I have created two desktop Icons with Its Window called Masters and Projects. By clicking Masters Icon It opens the master's window , after closing the master window It works fine when reopening it , But In case of projects window It opens the window for first time only, then I close the project's window, again I am trying to open It. It does not work until page refresh or reload.

I have used close action: 'hide' and close action: 'destroy'. But I am getting the same error.

Ext.override(Ext.Window, {
    closeAction: 'hide'
})

Please help me to do this Thanks in Advance.

1
can you post your code for hide and destroy? - dReAmEr
I had a similar issue, this might give you an idea on how to solve your own issue: stackoverflow.com/questions/27297256/… - code4jhon
Also what version of the version are you using? If 4 > 4.2.3 or 5 > 5.1 look into the release notes to see if there is an issue with you version. If you can upgrade version I would try that, if you are tied to that specific version look into the actual source code of the hide / close method and override it as in the question I put above. - code4jhon

1 Answers

1
votes

If the closeAction is hide, you must make sure that you create the window only once and that you keep a reference to the created window. Then you only call winRef.show(), not Ext.create.