1. #1
    Sencha User
    Join Date
    Jul 2009
    Posts
    88
    Vote Rating
    1
    Ash2009 is on a distinguished road

      0  

    Default How to set scope property for a handler function in Sencha Architect ?

    How to set scope property for a handler function in Sencha Architect ?


    I am writing an inline handler function to a button in Architect 2.0
    I noticed few issue, need help in figuring out this.
    1) There is no "scope" property in the list of properties available.
    2) I added a custom property called "scope" and set it to me (ie scope:me)
    but the code generated from sencha shows me as scope:'me'.
    It is treating "me" as a string here.Hence the scope doesn't get set correctly in the handler function.
    Is it a bug or is Am I missing something ? below is the code generated by Architect.
    Code:
     {
    xtype: 'button',
    handler: function(button, event) {
               console.log("save file");
    },
    scope: 'me', //this is where the issue is 
    text: 'Create'
    
    }
    Last edited by Ash2009; 8 Jul 2013 at 2:18 PM. Reason: REMOVED UNWANTED HTML TAGS

  2. #2
    Sencha User
    Join Date
    Jul 2009
    Posts
    88
    Vote Rating
    1
    Ash2009 is on a distinguished road

      0  

    Default


    I tried setting it to <this> instead of <me> , but the same issue happens.
    Last edited by Ash2009; 8 Jul 2013 at 2:23 PM. Reason: add tags to differentiate with quotes

  3. #3
    Sencha - Architect Dev Team
    Join Date
    Jan 2009
    Location
    Frederick, Maryland
    Posts
    890
    Vote Rating
    32
    jminnick has a spectacular aura about jminnick has a spectacular aura about

      0  

    Default


    Which object scope are you trying to gain access to? the buttons parent?
    Jason Minnick
    Sencha Architect Development Team

  4. #4
    Sencha User
    Join Date
    Jul 2009
    Posts
    88
    Vote Rating
    1
    Ash2009 is on a distinguished road

      0  

    Default


    yes the button parent which is a form. I figured there is a small selector button next to a custom property which lets you define whether the value of that property is number/boolean/object/string.
    I changed it to object and it started giving the right code.

    Thanks

Thread Participants: 1