ExtJS相当于jQuery的$(“。className”,parent)

时间:2011-08-05 10:11:57

标签: javascript extjs

我有JavaScript代码,其中ContentSection是包含ContentLeft和ContentRight div的div -

    var containerDivs = $(".ContentSection");
    for (var i = 0; i < containerDivs.length; i++) {
        var containerDiv = containerDivs[i];
        //Select right and left div's from the container div
        var leftDiv = $(".ContentLeft", containerDiv)[0];
        var rightDiv = $(".ContentRight", containerDiv)[0];

        if (leftDiv.clientHeight > rightDiv.clientHeight) {
            rightDiv.style.height = leftDiv.clientHeight;
        }
    }

我正试图从jQuery转移到ExtJS,但我不确定ExtJS等同于$(".cpfContentLeftWrapper", containerDiv)[0]是什么。

1 个答案:

答案 0 :(得分:2)

ExtJS analog:

Ext.query(".cpfContentLeftWrapper", containerDiv)[0]