Looks like we can't reproduce the issue or there's a problem in the test case provided.
Wrong scope in a controllerAction...
Ext version tested:
Browser versions tested against:
- FF (newest with firebug)
- Chrome (newest with firebug lite)
- 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
- I can just get the controller with Ext.getController... but thats not what i want...
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)
Just highlighting what you did to fix it.
Originally Posted by ChriZ
alright and sorry