How to use Jquery $(“.something”) to select a class in ExtJS?

前端 未结 3 1839
不知归路
不知归路 2021-01-12 11:10

I\'m looking for an equivalent method to select a class element like this $(\".className\") in Jquery for ExtJS.

I understand that Ext.get() only takes in an id. Yo

3条回答
  •  半阙折子戏
    2021-01-12 11:58

    Yes, Ext.select() is what you want. It returns a CompositeElement (same API as a single Element, but contains an internal collection of all selected elements). You could do this to see the widths of each element:

    Ext.select('.className').each(function(el){
        console.log(el.getWidth());
    }); 
    

    The way you called it is more useful for operating on the elements in some way, e.g.:

    Ext.select('.className').setWidth(100);
    

提交回复
热议问题