0

我有安装了许可证的企业版 ag-grid 并且似乎工作正常,但是无论我从 ag-grid 网站上的代码尝试什么实现,我的侧边栏都不会显示。企业分组工作正常,所有其他数据输入都显示正常。如果侧边栏为真或假或任何其他设置,则表格根本不会改变。

目前我有:

import { RowGroupingModule } from '@ag-grid-enterprise/row-grouping';
import { AllModules } from "@ag-grid-enterprise/all-modules";
import { ClientSideRowModelModule } from "@ag-grid-community/client-side-row-model";
import { AgGridVue } from "@ag-grid-community/vue";

import '@ag-grid-community/all-modules/dist/styles/ag-grid.css';
import '@ag-grid-community/all-modules/dist/styles/ag-theme-material.css';

export default {
    data() {
        return {
            columnDefs: null,
            autoGroupColumnDef: null,
            defaultColDef: null,
            rowData: {test: "Loading..."},
            rowSelection: null,
            rowGroupPanelShow: null,
            aggFuncs: null,
            gridApi: null,
            columnApi: null,
            sideBar: null,
            modules: [ClientSideRowModelModule, AllModules, RowGroupingModule],

        }
      },
      methods: {
        onGridReady(params) {
            this.gridApi = params.api;
            this.columnApi = params.columnApi;                         
       },
      components: {
            AgGridVue,
      },
      created(){
          this.sideBar = true;
      },
    }
    <ag-grid-vue style="width: 100%; height: 100%;"
        class="ag-theme-material"
        :autoGroupColumnDef="autoGroupColumnDef"
        :defaultColDef="defaultColDef"
        :columnDefs="columnDefs"
        :rowData="rowData"
        :modules="modules"
        :rowGroupPanelShow="rowGroupPanelShow"
        :sideBar="sideBar"
        :groupIncludeFooter="true"
        :aggFuncs="aggFuncs"
        rowSelection="single"
        @grid-ready="onGridReady"
        @column-row-group-changed="onColumnRowGroupChanged"
        @row-selected="onRowSelected"
        @firstDataRendered="onFirstDataRendered">
    </ag-grid-vue>
    

4

1 回答 1

0

我使用以下方法解决了这个问题:

import { RowGroupingModule } from '@ag-grid-enterprise/row-grouping';
import { AllModules } from "@ag-grid-enterprise/all-modules";
import { MenuModule } from '@ag-grid-enterprise/menu';
import { SetFilterModule } from '@ag-grid-enterprise/set-filter';
import { ColumnsToolPanelModule } from '@ag-grid-enterprise/column-tool-panel';
import { FiltersToolPanelModule } from '@ag-grid-enterprise/filter-tool-panel';
import { ClientSideRowModelModule } from "@ag-grid-community/client-side-row-model";
import { AgGridVue } from "@ag-grid-community/vue";

import '@ag-grid-community/all-modules/dist/styles/ag-grid.css';
import '@ag-grid-community/all-modules/dist/styles/ag-theme-material.css';
   
   export default {    
        data() {
            return {
               modules: [ClientSideRowModelModule, AllModules, RowGroupingModule, SetFilterModule, MenuModule, ColumnsToolPanelModule, FiltersToolPanelModule]
               }
              }
             }

于 2021-12-15T20:36:03.643 回答