Search code examples
extjsextjs4

How to destroy ExtJS application?


I am writing unit tests for my ExtJS application. I use an authentication method that creates the application upon successful authentication.

But I run into problems if I want to execute this method more than once, since the application would be created more than once.

How can I destroy the ExtJS application?

MyApp.destroy() doesn't work.


Solution

  • In Ext JS 4, Controllers and Applications do not support destroying. You can destroy and recreate the Viewport as @chinabuffet suggests, but you should assume that Application object is immortal and refactor your app logic around that.