PDA

View Full Version : Ext.queryCmp



LesJ
28 May 2011, 6:29 AM
Would it be possible to add Ext.queryCmp() as a shortcut for Ext.ComponentQuery.query()?



var panelsArray = Ext.ComponentQuery.query('panel'); // long form
var panelsArray = Ext.queryCmp('panel'); // shortcut

mitchellsimoens
28 May 2011, 5:02 PM
I personally don't think this is needed. You have the up, down and query methods on each Component that should suffice for almost every situation.

LesJ
28 May 2011, 5:48 PM
OK... Search the Ext code base... Ext.ComponentQuery.query is used in many places... if you used the shorter form, you could save a few bytes :)

ValterBorges
31 May 2011, 7:41 AM
Agree with Les,

For consistency and the same reason Ext.getStore exists.

Also why is it not part of ComponentManager in a method called query?
Wouldn't that make it more consistent with the other managers storeManager, windowManager, etc..?

sarimarton
16 Jan 2014, 8:06 AM
I agree, this is needed.

LesJ
19 Nov 2015, 1:24 PM
I personally don't think this is needed. You have the up, down and query methods on each Component that should suffice for almost every situation.


Looks like this mapping is now available in Ext JS 6.

Ext.all (http://docs.sencha.com/extjs/6.0/6.0.1-classic/#!/api/Ext-method-all)