12 Jan 2012 9:15 AM #1
Alias for Ext.ComponentQuery.query()
Ext.ComponentQuery.query() is an amazingly powerful and useful function. I've been using it all over the place. The only problem with it is that it's a pretty long name for something that's used so often - in jQuery, for example, a roughly analogous function is aliased to $() for convenience.
So, since I couldn't find anything in PR3 regarding an alias for this function, I created my own:
/* Create alias "Ext.cq()" for "Ext.ComponentQuery.query()".
var applyButton = Ext.cq('[action="apply"]', this);
Ext.cq = Ext.Function.alias(Ext.ComponentQuery, 'query');
12 Jan 2012 10:32 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
Each component has convenient methods to do this... child, down, query, upMitchell Simoens @SenchaMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services email@example.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.