1. #1
    Sencha Premium Member
    Join Date
    Nov 2007
    Posts
    399
    Vote Rating
    11
    Mthor will become famous soon enough

      0  

    Default scope issue on events

    scope issue on events


    I add an event to a store and I get the following produced code.

    Capture.PNG

    shouldn't the scope be created by the generated code?

    where scope: me is included? it is not being included for me.

    Thanks

  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


    Touch automatically calculates this.

    Your onPendingStoreAddRecords should be running in the scope of the class you've defined.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Sencha Premium Member
    Join Date
    Nov 2007
    Posts
    399
    Vote Rating
    11
    Mthor will become famous soon enough

      0  

    Default


    I added an event to the store, in the first post the screen shot is what architect generated, when I go add a record to the store the event is called. Once in the event it is out of scope, since there is no scope: me like it says in the docs. In the docs it states the scope: me gets generated, this is not what is happening. so I am now having scope issues. when I try to access (this) once in the event, (this = the current store that the event was added)

  4. #4
    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


    Quote Originally Posted by Mthor View Post
    I added an event to the store, in the first post the screen shot is what architect generated, when I go add a record to the store the event is called. Once in the event it is out of scope, since there is no scope: me like it says in the docs. In the docs it states the scope: me gets generated, this is not what is happening. so I am now having scope issues. when I try to access (this) once in the event, (this = the current store that the event was added)
    With the above code paste thats what I'd expect... what is this a subclass of? What did you expect this to be?
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  5. #5
    Sencha Premium Member
    Join Date
    Nov 2007
    Posts
    399
    Vote Rating
    11
    Mthor will become famous soon enough

      0  

    Default


    ah, I see what you are saying, ok, I got ahead of myself, yes you are right it is acting as it should., My bad, thanks for clarifying.