1. #1
    Sencha User
    Join Date
    Jun 2010
    Posts
    18
    Vote Rating
    0
    alexwebb2 is on a distinguished road

      0  

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

    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'); 
    Perhaps the Sencha team would consider including a similar alias in the final version of Sencha Touch 2?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,327
    Vote Rating
    850
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Each component has convenient methods to do this... child, down, query, up
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1