Results 1 to 4 of 4

Thread: Action columns in grid column header menu

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    21

    Default Answered: Action columns in grid column header menu

    We have a grid with 2 action columns created :
    Code:
    return Ext.create("Ext.grid.column.Action", {
                dataIndex: 'index',
                text: col.title,
                width: 'auto',
                icon: 'resources/images/default/icon/viewAttachment.gif',
                align: 'center',
                tooltip: 'View attachment',
                sortable: false,
                getClass: me._getAttachmentColumnCss,
                handler: me._viewAttachment
            });
    but the column menu header just lists the column as "Actions", it doesn't use the text.
    How are we supposed to fix this?

  2. Try to use menuText instead of text:
    Code:
    return Ext.create("Ext.grid.column.Action", {
        dataIndex: 'index',
     //   text: col.title,
        menuText: col.title,
        width: 'auto',
        icon: 'resources/images/default/icon/viewAttachment.gif',
        align: 'center',
        tooltip: 'View attachment',
        sortable: false,
        getClass: me._getAttachmentColumnCss,
        handler: me._viewAttachment
    });

  3. #2
    Sencha User
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    347

    Default

    Try to use menuText instead of text:
    Code:
    return Ext.create("Ext.grid.column.Action", {
        dataIndex: 'index',
     //   text: col.title,
        menuText: col.title,
        width: 'auto',
        icon: 'resources/images/default/icon/viewAttachment.gif',
        align: 'center',
        tooltip: 'View attachment',
        sortable: false,
        getClass: me._getAttachmentColumnCss,
        handler: me._viewAttachment
    });

  4. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    21

    Default

    thank you, so many config items that they seem to hide.

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

    Default

    http://docs.sencha.com/ext-js/4-1/#!...n-cfg-menuText

    The docs are a little misleading as menuText takes precedence over text. For a normal column that doesn't matter as the menuText defaults to null but for an Action column it defaults to Actions.

    You could either set both text and menuText to the same value of just null out the menuText.

    Getting lost in config options is easily done but the way to find things like this is to look at the code. The menu text of Actions must be coming from somewhere and if you just open the code to Action column it is pretty obvious where it's coming from.

Posting Permissions

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