EXTJS 6.x-禁用网格标头菜单



我正在构建一个Extjs 6应用程序,该应用程序具有从通用类中构建的许多网格。该通用类将默认启用的网格标头菜单设置,但有时我需要禁用它,并且我不知道该怎么做。

这是构建主要网格配置的类

Ext.define('App.view.override.TMainBrowseGrid', {
    override: 'App.view.TMainBrowseGrid',
    initComponent: function () {
        /* [A LOT OF IRRELEVANT CODE HERE] */

        var oBuildCol = {};
        /* [MORE OF IRRELEVANT CODE HERE] */
            oBuildCol = {
                xtype: cTipoCol,
                itemId: (oCol.cSQLField === '' ? (oCol.cFieldName === '' ? null : oCol.cFieldName) : oCol.cSQLField),
                dataIndex: (oCol.cSQLField === '' ? oCol.cFieldName : oCol.cSQLField),
                text: oIdioma.Get(oCol.Header),
                hidden: (oCol.lVisible == true ? false : true),
                hideable: true,
                sortable: false,
                draggable: true,
                align: oViewModel.getFormulas().getHeaderAlign(oCol.nAlignment),
                tdCls: 'oGridCell-' + oViewModel.getFormulas().getCellAlign(oCol.nAlignment),
                width: oCol.nWidth,
                flex: (oCol.nWidth == 999 ? 1 : 0),
                minWidth: (oCol.nWidth == 999 ? 140 : 40),
                cCode: oCol.SrcOnGetData,
                summaryType: oTipoSummary,
                summaryRenderer: (oTipoSummary !== null ? Function('val', 'params', 'data', 'return "<b>"+val+"</b>";') : null),
                renderer: (oCol.SrcOnGetData === '' ? false : function (value, metaData, record, rowIndex, colIndex, store, view) {
                    if (typeof metaData.column == 'undefined') {
                        if (typeof value == 'undefined') {
                            return '';
                        }
                        else {
                            return value;
                        }
                    }
                    var cCode = metaData.column.cCode;
                    if (cCode.length !== 0) {
                        eval(cCode);
                    }
                    return value;
                })
            };
        /* [EVEN MORE IRRELEVANT CODE HERE !!! ] */
        this.callParent();
    }
});

这是我的视图代码:

Ext.define('App.view.TFormFrm', {
    extend: 'Ext.tab.Panel',
    alias: 'widget.TFormFrm',
    requires: [
        'App.view.TFormFrmViewModel',
        'App.view.TFormFrmViewController',
        'Ext.tab.Tab',
        'Ext.grid.Panel',
        'Ext.grid.column.RowNumberer',
        'Ext.view.Table',
        'Ext.toolbar.Paging',
        'App.view.XBrowseColumn',
        'App.model.oGridForm',
        'App.model.oGridActs',
        'Ext.grid.plugin.DragDrop',
        'Ext.selection.RowModel'
    ],
    config: {
        nNivel: 0,
        cAwp: 'TGlobalData',
        cCodClass: 'FormBrw'
    },
    controller: 'TFormFrm',
    viewModel: {
        type: 'TFormFrm'
    },
    cls: 'CustomTabs',
    activeTab: 0,
    itemId: 'TFormFrm',
    bind: {
        title: '{lbl_Form}'
    },
    titleAlign: 'center',
    deferredRender: false,
    listeners: {
        afterrender: 'onTFormFrmAfterRender'
    },
    items: [
        {
            xtype: 'panel',
            itemId: 'oMainPanel',
            layout: {
                type: 'vbox',
                align: 'stretch'
            },
            bind: {
                title: '{lbl_Form}'
            },
            tabConfig: {
                hidden: true
            },
            dockedItems: [
                {
                    xtype: 'XActionToolbarFrm',
                    flex: 1,
                    dock: 'top',
                    itemId: 'oGridToolbar',
                    /* [IRRELEVANT CODE HERE] */
                }
            ],
            items: [
                {
                    xtype: 'panel',
                    flex: 1,
                    itemId: 'oPnlCard',
                    layout: {
                        type: 'card',
                        deferredRender: false
                    },
                    items: [
                        {
                            xtype: 'panel',
                            itemId: 'oPnlContenedor',
                            layout: {
                                type: 'hbox',
                                align: 'stretch'
                            },
                            items: [
                                {
                                    xtype: 'TMainBrowseGrid',
                                    cBrwName: 'oBrwForm',
                                    cCodForm: 'FormFrm',
                                    alignOnScroll: false,
                                    scrollable: true,
                                    menuDisabled: true,
                                    cls: 'CustomGrid',
                                    itemId: 'oGridForm',
                                    bind: {
                                        store: '{oStoreForm}'
                                    },
                                    columns: [
                                        {
                                            xtype: 'rownumberer',
                                            hidden: true
                                        }
                                    ],
                                    dockedItems: [
                                        {
                                            xtype: 'TPagingTB',
                                            dock: 'bottom',
                                            bind: {
                                                store: '{oStoreForm}'
                                            }
                                        }
                                    ],
                                    listeners: {
                                        select: 'onFormSelect'
                                    }
                                },
                                {
                                    xtype: 'TMainBrowseGrid',
                                    cBrwName: 'oBrwActs',
                                    cCodForm: 'ActsFrm',
                                    alignOnScroll: false,
                                    scrollable: true,
                                    cls: 'CustomGrid',
                                    itemId: 'oGridActs',
                                    bind: {
                                        store: '{oStoreActs}'
                                    },
                                    columns: [
                                        {
                                            xtype: 'rownumberer',
                                            hidden: true
                                        }
                                    ],
                                    dockedItems: [
                                        {
                                            xtype: 'TPagingTB',
                                            dock: 'bottom',
                                            bind: {
                                                store: '{oStoreActs}'
                                            }
                                        }
                                    ],
                                    listeners: {
                                        afterrender: 'onOGridActsAfterRender'
                                    }
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
});

我尝试在视图中几乎所有地方设置menuDisabled: true设置,但似乎不起作用。我应该如何处理?

非常感谢。

如果要禁用所有标题,请在网格本身上使用enablecolumnheaders。