PDA

View Full Version : Disabling header context menu in grid



bone
2 Mar 2007, 7:36 AM
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?

jack.slocum
2 Mar 2007, 8:00 AM
There are some new config options for this stuff in 1.0. Unfortunately, their naming isn't very consistent.


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
});

bone
5 Mar 2007, 12:18 AM
thank you!
*bow*

jaydipdave
17 Mar 2008, 10:34 PM
// 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

t_andrey
4 Apr 2008, 6:05 AM
Using menuDisabled:true i remove all the menus...
I just wanna remove the columns option (shown in the attachment)

What should I do?

Thks

mjlecomte
4 Apr 2008, 6:09 AM
Does http://extjs.com/deploy/dev/docs/?class=Ext.grid.ColumnModel&member=hideable help?

t_andrey
4 Apr 2008, 6:33 AM
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

fbx77
9 Apr 2008, 2:10 AM
Defining grid you've to set enableColumnHide to false like this:



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'
});

t_andrey
9 Apr 2008, 3:05 AM
Perfect!!!!!
=)

Thank you very much :P

classic037
17 Jul 2009, 3:05 AM
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.

mjlecomte
17 Jul 2009, 3:33 AM
If the column is hidden and you don't want the user to be able to unhide / hide it then simply do not include that column in the column model at all.

classic037
17 Jul 2009, 4:01 AM
Thank for you replay

but m using this hidden column value in other place but any way i got solution:
insted of hidden:true in column model need to write hideable:false and my column is not display in column menu.

mjlecomte
17 Jul 2009, 4:07 AM
You only include it in the column model if you want it shown. If you never want it shown visually do not include it. The data will still be available as you will still include it in your store configuration.

classic037
17 Jul 2009, 4:15 AM
ys u r right. :-?

craypu
17 Dec 2009, 7:38 AM
I'm using Grid<ModelData> to create a grid. I need to disable column from the context menu, but i do not have enableColumnHide:false option.

How to remove column from the context menu?

Thx

paulwolbers
23 May 2016, 5:58 AM
Using menuDisabled:true i remove all the menus...
I just wanna remove the columns option (shown in the attachment)

What should I do?

Thks

Perhaps you added the option to the grid instead of the column?