首页 > 解决方案 > 在 ag-grid mo 的 vue 中找到 columnGroupShow

问题描述

我的 html

              <ag-grid-vue style="height: 100%;"
                 class="ag-theme-alpine"
                 :columnDefs="columnDefs"
                 :rowData="records"
                 :gridOptions="gridOptions"
                 :defaultColDef="defaultColDef"
                 :debug="true"
                 >
             </ag-grid-vue>

我的 json 标头

         this.columnDefs = [
                     {
            headerName:'Datos del productos',
            children:[
                {headerName:'Código Interno', columnGroupShow: 'open', field: 'internal_id',  },
                {headerName:'Unidad', columnGroupShow: 'open', field: 'unit_type_id', width: 120,suppressSizeToFit:true,  },
                {headerName:'Nombre', columnGroupShow: 'open', field: 'name',  },
                {headerName:'Ver',   columnGroupShow: 'open', filter:false , width: 80, suppressSizeToFit:true},
                {headerName:'Descripción ampliada',  columnGroupShow: 'open', field: 'description', width: 200, suppressSizeToFit:true},
                {headerName:'Código Barras', columnGroupShow: 'open', field: 'barcode'},
                {headerName:'Código SUNAT', columnGroupShow: 'open', field: 'item_code'},
                {headerName:'Código de importación', columnGroupShow: 'open', field: ''},
            ],
        },
      }

我想隐藏或显示我拥有的列,但是在设置配置时,打开或关闭的 columngroupshow 在 html 中不起作用

未找到是列中的组显示,请帮助

标签: javascripthtmlvue.jsag-gridag-grid-vue

解决方案


问题是所有子列都有columnGroupShow:'open'. 换句话说,这没有任何效果

要解决此问题,请让列具有columnGroupShow:'closed'或不具有该属性。


推荐阅读