问题描述
我的 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',field: 'unit_type_id',width: 120,suppressSizetoFit:true,{headerName:'Nombre',field: 'name',{headerName:'Ver',filter:false,width: 80,suppressSizetoFit:true},{headerName:'Descripción ampliada',field: 'description',width: 200,{headerName:'Código Barras',field: 'barcode'},{headerName:'Código SUNAT',field: 'item_code'},{headerName:'Código de importación',field: ''},],}
我想隐藏或显示我拥有的列,但是在设置配置时,打开或关闭的 columngroupshow 在 html 中不起作用
未找到列中的群展,请帮忙
解决方法
问题是所有子列都有 columnGroupShow:'open'
。换句话说,这没有效果。
要解决此问题,请使用一列包含 columnGroupShow:'closed'
或根本不包含该属性。