1. #1
    Sencha User makana's Avatar
    Join Date
    Apr 2008
    Location
    Dresden, Germany
    Posts
    527
    Answers
    3
    Vote Rating
    19
    makana has a spectacular aura about makana has a spectacular aura about

      0  

    Default Answered: HowTo ComponentQuery w/o dockedItems?

    Answered: HowTo ComponentQuery w/o dockedItems?


    Hi,

    I've got a question. How do I query components from a panel without including the dockedItems?

    If I have a TabPanel for example and query
    Code:
    tabPanel.child('[isDockablePlaceholder!=true]');
    I always get a result including the TabBar. What's special here maybe is that I want to query components, that do NOT have a specific property - 'isDockablePlaceholder' here.

    Sure I can do (and I do - and I guess it's even faster)
    Code:
    tabPanel.items.findBy(function(item) {
    	return !item.isDockablePlaceholder;
    });
    but my question is, if it is generally possible to exclude dockedItems in child/down/query/etc.-methods?


    When I look at the docs for "child" it says
    Retrieves the first direct child of this container which matches the passed selector or component.
    IMO, children of a container do not include dockedItems but only "items", since docked items are meant to be something special within a component, but not a child in terms of "items". But that's of course just my point of view and I'm sure there are reasons to consider docked items as children.

    Regards
    Programming today is a race between software engineers striving to build bigger and better іdiot-proof programs, and the universe striving to produce bigger and better idiots. So far, the universe is winning. (Rick Cook)

    Enhanced ExtJS adapter for Adobe AIR

  2. Check the pseudo selectors (the 'not'' one perhaps)

    http://docs.sencha.com/extjs/4.2.0/#...ComponentQuery

  3. #2
    Ext JS Premium Member tvanzoelen's Avatar
    Join Date
    Apr 2008
    Location
    Groningen - Netherlands
    Posts
    1,118
    Answers
    85
    Vote Rating
    30
    tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about

      0  

    Default


    If you search for components you might try the down function.

    See for the documentation here.

    http://docs.sencha.com/extjs/4.2.1/#...ComponentQuery

  4. #3
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    2,761
    Answers
    33
    Vote Rating
    108
    mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all

      0  

    Default


    Check the pseudo selectors (the 'not'' one perhaps)

    http://docs.sencha.com/extjs/4.2.0/#...ComponentQuery

  5. #4
    Sencha User makana's Avatar
    Join Date
    Apr 2008
    Location
    Dresden, Germany
    Posts
    527
    Answers
    3
    Vote Rating
    19
    makana has a spectacular aura about makana has a spectacular aura about

      0  

    Default


    I did not recognize the not pseudo selector.

    The following works:
    Code:
    tabPanel.child('[isDockablePlaceholder!=true]:not([dock])');
    Thanks @mankz
    Programming today is a race between software engineers striving to build bigger and better іdiot-proof programs, and the universe striving to produce bigger and better idiots. So far, the universe is winning. (Rick Cook)

    Enhanced ExtJS adapter for Adobe AIR

Thread Participants: 2