1. #1
    Ext User
    Join Date
    Mar 2010
    Posts
    14
    Vote Rating
    0
    kodomo is on a distinguished road

      0  

    Thumbs up Direct method callback scope

    Direct method callback scope


    I searched in the documentation and didn't see any reference... but in the code I found that can be done this way

    the common way is:

    Code:
    Action.Method({params},callbackFn);
    but can also be done this way:

    Code:
    Action.Method({params},{fn: callbackFn, scope:this});
    if it's of use to anyone

    Cheers
    Israel Figueroa
    Last edited by kodomo; 30 Sep 2010 at 7:45 PM. Reason: fix

  2. #2
    Sencha User
    Join Date
    Apr 2008
    Location
    Germany
    Posts
    24
    Vote Rating
    0
    Yasheena is on a distinguished road

      0  

    Default


    I tried this, but doesn't work with Ext 3.3.0. I traced it and found out, that in all 3.x.x versions we have to use 'callback' instead of 'fn':
    Code:
    Action.Method({params},{callback: callbackFn, scope:this});
    Greetings,
    Wolfgang

  3. #3
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    91
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Or you could use:
    Code:
    Action.Method({params},callback.createDelegate(this));

Similar Threads

  1. Replies: 4
    Last Post: 28 Oct 2010, 1:56 PM
  2. Direct Method not firing callback.
    By colin.jones in forum Ext.Direct
    Replies: 1
    Last Post: 2 Oct 2009, 3:08 AM
  3. [2.2.1/2.3.0] HttpProxy loosing callback scope
    By smudgeface in forum Ext 2.x: Bugs
    Replies: 3
    Last Post: 13 Aug 2009, 4:09 AM
  4. callback function and scope
    By dddu88 in forum Ext 2.x: Help & Discussion
    Replies: 10
    Last Post: 18 Nov 2007, 11:11 AM
  5. How to keep scope in selectPath callback?
    By mherger in forum Ext 1.x: Help & Discussion
    Replies: 5
    Last Post: 8 Aug 2007, 11:33 PM

Thread Participants: 2