View Full Version : [CLOSED] Removing extra columns from the menu of a gridpanel

Jan 13, 2015, 4:57 AM
I have gridpanel, based on some conditions i will be showing/hiding some of the columns. But the hidden columns can be unhide anytime using the menu option. Please find the attached image below. Let me know what property to be set to remove the hidden columns from the menu list.


Jan 13, 2015, 6:14 AM

Inside your gridpanel define a listener to customize the context menu:

<ViewReady Handler="customMenu(this);" />

The handler function accesses the context menu and hides the first and second column checkbox options:

<script type="text/javascript">
var customMenu = function(obj) {
var menu = obj.getView().headerCt.getMenu();
menu.items.get('columnItem').menu.items.get(0).hid e();
menu.items.get('columnItem').menu.items.get(1).hid e();

Hope it helps.