lib/Ext/Component.js
function(selector) {
        var result = this.parent;

        if (selector) {
            for (; result; result = result.parent) {
                if (Ext.ComponentQuery.is(result, selector)) {
                    return result;
                }
            }
        }
        return result;
    }
function(selector) {
        var result = this.parent;

        if (selector) {
            for (; result; result = result.parent) {
                if (Ext.ComponentQuery.is(result, selector)) {
                    return result;
                }
            }
        }
        return result;
    }
Walks up the `ownerCt` axis looking for an ancestor Container which matches
the passed simple selector.

Example:

var owningTabPanel = grid.up('tabpanel');

@param {String} selector (optional) The simple selector to test.
@return {Ext.Container} The matching ancestor Container (or `undefined` if no match was found).