Results 1 to 5 of 5

Thread: Disabling a item in Ext.grid.column.Action

  1. #1
    Sencha User
    Join Date
    May 2010
    Location
    Bogota
    Posts
    27

    Question Disabling a item in Ext.grid.column.Action

    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 but it's not working

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,791
    Answers
    585

    Default

    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/#!...-disableAction

  3. #3
    Sencha User
    Join Date
    May 2010
    Posts
    12

    Default

    Yes,
    I try use disable column.Action or a Item of column.Action but don't work....
    :-(

  4. #4
    Sencha User
    Join Date
    Oct 2012
    Posts
    3

    Default Same problem here.

    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.

  5. #5
    Sencha Premium Member
    Join Date
    Sep 2011
    Posts
    51

    Default

    Quote Originally Posted by skirtle View Post
    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/#!...-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?

Tags for this Thread

Posting Permissions

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