-
6 Nov 2011 5:15 AM #11
To emulate that behavior, I set the itemId of the widget, and then in the controller:
Maybe not than fast as #centerButton but at least is so specific.Code:control: 'MyPanel button[itemId="centerButton"]': { ... }
-
10 Nov 2011 11:51 AM #12
I'm happy to hear that someone knows this. I'm currently having issues accessing an item within an action column:
I cannot get to #watch to save my life. I can get to the actioncolumn with:PHP Code:{
header : 'Actions',
sortable : false,
menuDisabled : true,
width : 100 ,
xtype : 'actioncolumn',
align : 'center',
items: [{
iconCls: 'fam_accept',
tooltip: 'Watch Project',
itemId: 'watch',
bodyStyle : 'width:16px'
}, {
icon: '/icons/application_go.png',
itemId : 'show',
tooltip: 'Show Dashboard'
}]
}
but applying the item id gets me nowhere:PHP Code:
'projectList actioncolumn': {
click: this.watchProject
},
Anyone know what I'm missing here?PHP Code:
'projectList actioncolumn #watch': {
click: this.watchProject
},
-
10 Nov 2011 11:57 AM #13
I'm shooting in the dark myself but I don't think itemId turns into a css ID - isn't it 'id'? try:
Code:'projectList actioncolumn [itemId="watch"]': {...
-
10 Nov 2011 12:06 PM #14
Yes, I tried that as well with no luck. I want to do this right, but I cannot seem to get the selectors to work properly with action columns. I'm going to do more research...
-
10 Nov 2011 12:13 PM #15
OK, now that I've thought about this for a while, I can see why my selector does not work. Upon inspecting the items within the action column, the items added are not components. They are plain ol' images.
Per rdougan's comment, only "components" may be accessible from the controller.
That kind of makes the action column pretty lame for MVC development now, doesn't it?
-
24 Feb 2013 10:16 AM #16
I have the same problem. I agree that we should avoid putting logic in the view. However, my buttons are generated dynamically, so I want my runtime button to be well encapsulated. It might be debatable if this is good design. However, I'm really hoping the controllers are more accessible from anywhere. I will go on to do some investigation, and come back here if I found a way.
-
24 Feb 2013 10:42 AM #17
Now I have a temporary workaround, but the performance seems to be very poor.
var controller =Ext.create('Full.Classname.Of.Your.Controller');The code above happens in my button handler. The reason I need to put this logic in a button controller instead of the controllers is that my buttons are generated dynamically at run time. I need my button's to be well encapsulated instead of having a footprint in the controller. My code si 4.1.1a. Thanks.


Reply With Quote

