1. #1
    Sencha User
    Join Date
    Feb 2011
    Posts
    6
    Vote Rating
    0
    c.wenzel is on a distinguished road

      0  

    Default Action Property for elements in Achitect?

    Action Property for elements in Achitect?


    Hi @all,

    I just started with the new Achitect and love the MVC structure which is introduced with 4.1.
    In your examples (MVC in depth) you use an action property and use this property in the controllers controlQuery. This property is perfect for defining special groups of elements for my controllers.

    Is there a way i can use this concept with the Achitect? Is there an "free" property i can use for such a purpose?

    (And i think this propertys are not listed in the doc right now).

    Kind regards,
    Christian

  2. #2
    Sencha Premium Member
    Join Date
    Nov 2007
    Posts
    79
    Vote Rating
    4
    oldroy is on a distinguished road

      0  

    Default Actions?

    Actions?


    Is this the kind of thing you are asking about?
    Code:
    this.control({
                'button[action=deleteComment]': {
                    click: this.deleteComment
                }
    
            });
    If it is I think in general, the best practice on this is to have the button event listened to out on your view, and then fire a more general command, then listen for that command in your controller. In this code example above there were 3 places I was wanting to hook up the 'deleteCommentCommand'. Is this what you are getting at?

  3. #3
    Sencha User
    Join Date
    Feb 2011
    Posts
    6
    Vote Rating
    0
    c.wenzel is on a distinguished road

      0  

    Default


    Yes, it is the right direction. My question is, where can i define [action=deleteComment] at the button in the Architect?
    In my code editor i would use something like this:
    Code:
    xtype:'button',
    text: 'Send',
    action: 'deleteComment'
    But i can't do this in the Architect directly or can i? If not, is there some other way to achive the same result without dismissing the Architect completely?

  4. #4
    Sencha Premium Member
    Join Date
    Nov 2007
    Posts
    79
    Vote Rating
    4
    oldroy is on a distinguished road

      2  

    Default Action

    Action


    Go to the button in Architect. Go to the top of the Config explorer window. Type in action - click add. Add your action. Action isn't on the button cinfig but you can add it.

  5. #5
    Sencha User
    Join Date
    Feb 2011
    Posts
    6
    Vote Rating
    0
    c.wenzel is on a distinguished road

      0  

    Default


    Thank you very much; it is exactly what i need. I didn't know i can add properties. Perfect
    Thanks for the fast reply’s

Thread Participants: 1

Tags for this Thread