1. #1
    Touch Premium Member pkellner's Avatar
    Join Date
    Sep 2008
    Location
    San Jose, California
    Posts
    435
    Vote Rating
    1
    pkellner is on a distinguished road

      0  

    Default Need Help With Better Way to do "Convert to Action"

    Need Help With Better Way to do "Convert to Action"


    The scenario I think I've been doing poorly is for adding things like click events to controllers. My scenario is this: I put a panel on a viewport, on that panel I put a toolbar, on the toolbar I put a button, on that button I put a click event.

    Now, if I don't put an id with the click event and try to "Convert to Action" I get an error because the component query seems not to be full formed.

    What is the recommended way to do this and get a correct component query that is best practice for production?



    sa1.jpg

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    8,185
    Vote Rating
    63
    aconran is just really nice aconran is just really nice aconran is just really nice aconran is just really nice aconran is just really nice

      0  

    Default


    We can't reliably predict a controlQuery that will work in all situations.

    In the event that you set an id or itemId, we will use that for the controlQuery.

    In terms of best practices I would say use an itemId and ensure that they are unique across the container. You can also add an additional property like action: 'Save'

    and then use a controlQuery like 'button[action=Save]'
    Aaron Conran
    @aconran
    Sencha Architect Development Team