PDA

View Full Version : Disabling a item in Ext.grid.column.Action



lord_of_php
26 Sep 2011, 1:23 PM
Hi,

I'm using a Ext.grid.column.Action inside a Grid.Panel, is there any way to disable a item of a Ext.grid.column.Action ?
(for example, a action column with 'edit' and 'delete' items, disable 'delete' item) I have tried with the 'disabled' config option mentioned in Sencha Docs (http://docs.sencha.com/ext-js/4-0/#!/api/Ext.grid.column.Action (http://docs.sencha.com/ext-js/4-0/#%21/api/Ext.grid.column.Action) but it's not working

skirtle
27 Sep 2011, 1:18 AM
The disabled config option should definitely work. Could you post your code?

There's also a method for disabling an action after creation time:

http://docs.sencha.com/ext-js/4-0/#!/api/Ext.grid.column.Action-method-disableAction

cdavide75
31 Oct 2011, 5:07 AM
Yes,
I try use disable column.Action or a Item of column.Action but don't work....
:-(

Moksh
18 Oct 2012, 2:21 AM
xtype: 'actioncolumn',
width: 100,
items: [
{

icon : '/gep/icons/newmore.gif', // Use a URL in the icon config
tooltip: selectActionToolTip,
handler: function(view, recIndex, node, index,event) {
event.stopEvent();
var contextMenu=createContextMenu(gridObj,recIndex);
contextMenu.showAt(event.getXY());
return false;}
}
]

want to enable this only item in the actioncolumn on selecting the same row checkbox. By default all icons in actioncolumn are disabled.

Help.

stahlman
5 Jul 2013, 8:47 AM
The disabled config option should definitely work. Could you post your code?

There's also a method for disabling an action after creation time:

http://docs.sencha.com/ext-js/4-0/#!/api/Ext.grid.column.Action-method-disableAction

But what if you want to disable the action in specific rows only? It seems to be way too difficult to access a component within an arbitrary cell (i.e., specific row/column) of a grid. For example, if I want to disable the Checkbox in a specific row, I'm stuck with setting tdCls in a renderer to 'x-item-disable', then putting logic in the click handler to ensure that the click is ignored (since tdCls doesn't really disable anything). There's no easy way to grab the Checkbox component and invoke its disable method. Although there may be times you want to disable all actions in a specific column as a group, that is certainly not the only (or even most common) use case. Are there some methods I've overlooked for this sort of thing?