Results 1 to 3 of 3

Thread: Wrong scope in a controllerAction...

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    12
    Vote Rating
    -1
      0  

    Default Wrong scope in a controllerAction...

    REQUIRED INFORMATION

    Ext version tested:
    • Ext 4.0.7-commercial

    Browser versions tested against:

    • FF (newest with firebug)
    • Chrome (newest with firebug lite)

    Description:
    • I have a simple Controller with a Panel Reference and a Controller Action.
    • Inside the Controller Action "this" = the element not the Controller

    Steps to reproduce the problem:
    • Create a Panel (itemId: navigation)
    • Create a Controller
    • Create a Controller Reference (ref: navigation; selector: #navigation)
    • Create a Controller Action
      (controlQuery: navigation; targetType: Ext.panel.Panel; fn:onNavigationResize; name: resize;
    • alert(this.getItemId()); in the Controller Action
      (the getItemId() returns #navigation...(so the element) but it should be the controller)
    • On a TabPanel Action with a Reference (near the same) "this" = the controller not the element

    The result that was expected:
    • this in a Controller Action FN should be the controller

    The result that occurs instead:
    • this in a Controller Action FN is the Element

    Possible fix:
    • I can just get the controller with Ext.getController... but thats not what i want...

    Operating System:

    • Win7 Pro

    Is this a bug or am i missing something? i cant set the scope i think.

    *EDIT: i found what was wrong... cause i cant use an ItemId in the Controller Action ControlQuery... i used me.getNavigation().on('resize', me.onNavigationResize, this);
    now the scope is correct... (red marked)

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,326
    Vote Rating
    1297
      0  

    Default

    Quote Originally Posted by ChriZ View Post
    *EDIT: i found what was wrong... cause i cant use an ItemId in the Controller Action ControlQuery... i used

    me.getNavigation().on('resize', me.onNavigationResize);

    me.getNavigation().on('resize', me.onNavigationResize, this);
    now the scope is correct...
    Just highlighting what you did to fix it.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    12
    Vote Rating
    -1
      0  

    Default

    alright and sorry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •