Results 1 to 2 of 2

Thread: Alias for Ext.ComponentQuery.query()

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Jun 2010
    Vote Rating

    Default 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:

    PHP Code:
    /*    Create alias "Ext.cq()" for "Ext.ComponentQuery.query()".

            var applyButton = Ext.cq('[action="apply"]', this)[0];
    Ext.cq Ext.Function.alias(Ext.ComponentQuery'query'); 
    Perhaps the Sencha team would consider including a similar alias in the final version of Sencha Touch 2?

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    Each component has convenient methods to do this... child, down, query, up
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    Learn BBCode and use it!

    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.

    Need more help with your app? Hire Sencha Services

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts