Results 1 to 7 of 7

Thread: How to get all components in document by specific xtypes

  1. #1
    Sencha Premium User
    Join Date
    Jun 2009
    Posts
    319

    Default How to get all components in document by specific xtypes

    How to can I get all components in the document by specific xtypes?
    this does not work, because Ext.getBody() is not a container:
    Code:
    var allcombos=Ext.getBody().findBy(function(comp){ return comp.getXtypes().indexOf('/combo'); });

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    Use:
    Code:
    var combos = Ext.ComponentMgr.all.filterBy(function(c){
    	return c.isXType('combo');
    });

  3. #3
    Sencha Premium User
    Join Date
    Jun 2009
    Posts
    319

    Default

    Quote Originally Posted by Condor View Post
    Use:
    Code:
    var combos = Ext.ComponentMgr.all.filterBy(function(c){
        return c.isXtype('combo');
    });
    firebug reports:
    Code:
    c.isXtype is not a function
     return c.isXtype('combo');

  4. #4
    Sencha Premium User
    Join Date
    Jun 2009
    Posts
    319

    Thumbs up

    This work fine:
    Code:
    var allcombos = Ext.ComponentMgr.all.filterBy(function(c){
       return (c.getXTypes().indexOf('/combo')!=-1);
    });

  5. #5
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    Sorry, it's:
    Code:
    var combos = Ext.ComponentMgr.all.filterBy(function(c){
    	return c.isXType('combo');
    });
    (capital X, capital T)

  6. #6
    Sencha Premium User
    Join Date
    Jun 2009
    Posts
    319

    Default


    Thanks

  7. #7
    Sencha Premium User NoahK17's Avatar
    Join Date
    Apr 2008
    Location
    Atlanta, GA
    Posts
    538

    Default

    What's the Ext v6.x version of this?
    Noah
    Front-End Developer
    Norfolk Southern

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •