-
12 Jan 2012 9:15 AM #1
Alias for Ext.ComponentQuery.query()
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:
Perhaps the Sencha team would consider including a similar alias in the final version of Sencha Touch 2?PHP Code:/* Create alias "Ext.cq()" for "Ext.ComponentQuery.query()".
Example:
var applyButton = Ext.cq('[action="apply"]', this)[0];
*/
Ext.cq = Ext.Function.alias(Ext.ComponentQuery, 'query');
-
12 Jan 2012 10:32 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 435
Each component has convenient methods to do this... child, down, query, up
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
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 services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.


Reply With Quote