PDA

View Full Version : [CLOSED] Semantics of Element.child() and Element.down() have switched?!



Dipish
29 Nov 2011, 6:16 AM
I apologize for not using the bug reporting template but it's irrelevant here. If this is not a bug please close the thread.

In Ext 3 the semantics of the mentioned methods were the following:

child(): Selects a single child at any depth below this element based on the passed CSS selector...
down(): Selects a single direct child based on the passed CSS selector...
In Ext 4 it got reversed (according to the docs and apparently the behavior):

child(): Selects a single direct child based on the passed CSS selector...
down(): Selects a single child at any depth below this element based on the passed CSS selector...

Is this a bug?!

mitchellsimoens
29 Nov 2011, 2:54 PM
Not a bug. ComponentQuery is using the child/down like this so to be the same the child/down methods on Element were changed. Plus, it makes sense... child would tell me it will get a child where down would tell me it will keep digging until it finds one.

Dipish
30 Nov 2011, 12:48 AM
Not a bug. ComponentQuery is using the child/down like this so to be the same the child/down methods on Element were changed.
But ComponentQuery was introduced in Ext 4, it didn't exist in Ext 3, so that really isn't an explanation)


Plus, it makes sense... child would tell me it will get a child where down would tell me it will keep digging until it finds one.
I guess it does make sense, only that I already got used to opposite mnemonics)

But my question is answered, thanks for responding so quickly! I think the topic can be closed now.