Code:
    refreshSize: function() {
        var me = this,
            grid,
            bodySelector = me.getBodySelector();

        // On every update of the layout system due to data update, capture the view's main element in our private flyweight.
        // IF there *is* a main element. Some TplFactories emit naked rows.
        if (bodySelector) {
            me.body.attach(me.el.child(bodySelector, true));
        }

        if (!me.hasLoadingHeight) {
            grid = me.up('tablepanel');

            // Suspend layouts in case the superclass requests a layout. We might too, so they
            // must be coalescsed.
            Ext.suspendLayouts();

            me.callParent();

            // If the OS displays scrollbars, and we are overflowing vertically, ensure the
            // HeaderContainer accounts for the scrollbar.
            // If we need to measure row heights, update the layout
            if (grid && 
                (Ext.getScrollbarSize().width && me.scrollFlags.y) ||
                (grid.lockable && grid.syncRowHeight)
            ) {
                grid.updateLayout();
            }

            Ext.resumeLayouts(true);
        }
    },
if grid is undefined
Code:
 (grid.lockable && grid.syncRowHeight)
TypeError: grid is undefined
Maybe should be
Code:
            if (grid && 
                ((Ext.getScrollbarSize().width && me.scrollFlags.y) ||
                (grid.lockable && grid.syncRowHeight))
            )
?