REQUIRED INFORMATION

Ext version tested:
  • Ext 4.2.0 beta
Browser versions tested against:
  • Chrome
  • FireFox
  • IE9
DOCTYPE tested against:
  • <!DOCTYPE html>
Description:
  • Ext.get(window).getHeight() causes JS error. The same with Ext.fly. Uncaught TypeError: Cannot read property 'defaultView' of undefined
Steps to reproduce the problem:
  • Click the buttons
The result that was expected:
  • A window's height and width
The result that occurs instead:
  • A JavaScript error occrus
Test Case:

Code:
<!DOCTYPE html>
<html>
<head>
    <title>Ext.get(window).getHeight() causes JS error</title>

    <link rel="stylesheet" href="../resources/css/ext-all.css" />
    
    <script src="../ext-all-debug.js"></script>

    <script>
        Ext.onReady(function () {
            Ext.create("Ext.button.Button", {
                renderTo: Ext.getBody(),
                text: "Ext.get(window).getHeight()",
                handler: function () {
                    alert(Ext.get(window).getHeight());
                }
            });

            Ext.create("Ext.button.Button", {
                renderTo: Ext.getBody(),
                text: "Ext.fly(window).getWidth()",
                handler: function () {
                    alert(Ext.fly(window).getWidth());
                }
            });
        });
    </script>
</head>
<body>

</body>
</html>