I have developed an app which requires some container to be drawn based of height & width of device so I have used
[Ext.Viewport.getWindowHeight()][1] &
Ext.Viewport.getWindowWidth()
at few places in my code and it was working fine until I did sencha app build package
. When I tried to open the packaged app I got this error:
Uncaught TypeError: Cannot call method 'getWindowHeight' of undefined app.js:1 (anonymous function)
Similar issue was raised in Sencha forum in past but it is unanswered: http://www.sencha.com/forum/showthread.php?240494-Call-method-getWindowHeight-of-undefined
As per Sencha docs : Ext.Viewport is a instance created when you use Ext.setup and if you use Ext.onReady, this instance of Ext.Viewport will not be created. But in my app.js I am using Ext.application()
not Ext.setup
or Ext.onReady
,
is that the reason singleton is not created? If yes how can I fix it?
I am using Sencha Cmd Ver 3.0.2.288 & Sencha Touch ver 2.1.1