PDA

View Full Version : Component Selector to select a parent 'card' layout



shaym
11 Oct 2013, 1:46 AM
Hi guys,

Does anyone know if it is possible to use a component selector to return a parent panel which has a card layout.
So I can do the following:


button.up('panel').getLayout().type === 'card'

to determine if the parent panel is a card, but I would prefer to do so in a component selector,
for example something like this


button.up('panel[layout.type = card]') // this does not work as it's syntax is invalid

thanks,
Shay

ettavolt
11 Oct 2013, 5:00 AM
Hm, why don't just add itemId to that panel?

shaym
11 Oct 2013, 5:15 AM
I have already done something similar to that, but I was hoping to put in a more dynamic solution.
Maybe it's just not possible with the selectors.

ettavolt
11 Oct 2013, 8:43 AM
Yes, it is not possible, but I can't imagine what for do you need all panels with card layout.