Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Disabling header context menu in grid

  1. #1
    Sencha Premium User
    Join Date
    Mar 2007
    Location
    Norway
    Posts
    197

    Default Disabling header context menu in grid

    Dont ask why...

    This is a bit embarassing to ask for, but I just cant seem to figure out how to disable the headercontextmenu.

    I cant find a property in the grid that I can set to false.

    I know what function I should remove with un('headercontextmenu', function(g,_123,e){....})

    And I've tried to do addListener('headercontextmenu', function(){ X.hmenu.hide();});

    I've tried all kinds of paths with the X, I've tried all kinds of ways to adressing the function to remove from the listener-container.

    Im stuck.... is it at all possible to remove that menu?

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    6,956

    Default

    There are some new config options for this stuff in 1.0. Unfortunately, their naming isn't very consistent.

    Code:
    var grid = new Ext.grid.Grid('foo', {
        enableCtxMenu: false,  // turn off header context menu
        enableColLock: false,  // turn off column lock context items
        enableColumnMove: false,  // turn off column reorder drag drop
        enableColumnResize: false,  // turn off column resize for whole grid
        enableRowHeightSync: true // turn ON sync of locked and non locked row heights
    });

  3. #3
    Sencha Premium User
    Join Date
    Mar 2007
    Location
    Norway
    Posts
    197

    Default

    thank you!
    *bow*

  4. #4

    Lightbulb

    Code:
    // For seperate contex menu hiding ............ 2.0 +
        var cm = new xg.ColumnModel([
                {id:'rank',header: "Rank", width: 7, sortable: true, dataIndex: 'rank', menuDisabled: true},
                {header: "Ticker", width: 7, sortable: true, renderer:PutLink, dataIndex: 'ticker', menuDisabled: true},
                {header: "Name", width: 20, sortable: true, dataIndex: 'name', menuDisabled: true} ]);
    
    //enableHdMenu: false, // this grid option turns Off all the context menu
    Last edited by jaydipdave; 17 Mar 2008 at 10:34 PM. Reason: typo
    Jaydeep Dave
    M. 0091-9898456445
    E. [email protected]
    G.Talk: jaydipdave
    Skype: jaydipdave

  5. #5

    Default

    Using menuDisabled:true i remove all the menus...
    I just wanna remove the columns option (shown in the attachment)

    What should I do?

    Thks
    Attached Images Attached Images
    Last edited by t_andrey; 4 Apr 2008 at 6:07 AM. Reason: attachment

  6. #6

  7. #7

    Default

    Almost...
    Setting hideable:false to all colums i got what is shown in the attached figure.
    But the "Colunas" box stills being displayed.
    I want to hide it, take a look at the attachment.

    Thks
    Attached Images Attached Images

  8. #8

    Default

    Defining grid you've to set enableColumnHide to false like this:

    Code:
    panel = new Ext.grid.GridPanel({
            cm: myColumns,
            store: myDataStore,
            enableColumnMove: false,
            enableDragDrop: false,
            enableHdMenu: true,
            height:500,
            width:800,
            enableColumnHide:false,
            view: new Ext.grid.GridView({forceFit:true}),
            title:'Array Grid',
            plugins: plug,
            renderTo:'content'
    });

  9. #9

    Default

    Perfect!!!!!
    =)

    Thank you very much :P

  10. #10
    Sencha User
    Join Date
    Feb 2009
    Location
    Ahmedabad
    Posts
    17

    Default

    enableColumnHide:false remove the column menu from the menu list but what if i only want to remove particular column from the list.

    in my case i have one hidden column but i don't want to display in list see attachment.
    Attached Images Attached Images

Page 1 of 2 12 LastLast

Similar Threads

  1. Grid context menu
    By mdelanno in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 5 Mar 2007, 9:39 AM
  2. YUI-Ext grid context menu example
    By raphinou in forum Community Discussion
    Replies: 1
    Last Post: 26 Feb 2007, 12:19 PM
  3. Problem on Grid header context menu.
    By Animal in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 22 Feb 2007, 2:41 AM
  4. Grid with context menu
    By wolverine4277 in forum Ext 1.x: Help & Discussion
    Replies: 7
    Last Post: 12 Jan 2007, 6:55 AM

Posting Permissions

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