Skip to content

[Bug] 透视表只有指标的情况下,columnWidthConfig配置不生效 #4388

Description

@Rui-Sun

Version

Link to Minimal Reproduction

Steps to Reproduce

const option = {
  "records": [
    {
      "fldKwJwmQw_SUM": "{\"text\":\"256\",\"formatString\":\"\",\"fldKey\":\"fldKwJwmQw_SUM\",\"groupKey\":\"256\"}",
      "original": {
        "fldKwJwmQw_SUM": {
          "value": 256,
          "text": "256",
          "formatString": "",
          "groupKey": "256",
          "fldKey": "fldKwJwmQw_SUM"
        }
      }
    },
    {
      "fldKwJwmQw_SUM": "{\"text\":\"256\",\"formatString\":\"\",\"fldKey\":\"fldKwJwmQw_SUM\",\"groupKey\":\"256\"}",
      "original": {
        "fldKwJwmQw_SUM": {
          "value": 256,
          "text": "256",
          "formatString": "",
          "groupKey": "256",
          "fldKey": "fldKwJwmQw_SUM"
        }
      }
    }
  ],
  "rows": [],
  "columns": [],
  "indicators": [
    {
      "indicatorKey": "fldKwJwmQw_SUM",
      "title": "计数:主订单编号",
      "fieldId": "fldKwJwmQw",
      "statType": "COUNT",
      "width": "auto",
      "minWidth": 90
    }
  ],
  "dataConfig": {
    "aggregationRules": [
      {
        "indicatorKey": "fldKwJwmQw_SUM",
        "field": "fldKwJwmQw_SUM",
        "aggregationType": "NONE"
      }
    ],
    "sortRules": [
      {
        "sortField": "fldKwJwmQw",
        "sortType": "asc"
      }
    ]
  },
  "keyboardOptions": {
    "copySelected": true
  },
  "frozenColCount": 0,
  "defaultRowHeight": 32,
  "corner": {
    "titleOnDimension": "row",
    "headerStyle": {
      "textStick": false
    }
  },
  "widthMode": "autoWidth",
  "rowHierarchyIndent": 20,
  "rowHierarchyTextStartAlignment": true,
  "hideIndicatorName": false,
  "limitMaxAutoWidth": 370,
  "columnWidthConfig": [
    {
      "dimensions": [
        {
          "indicatorKey": "fldKwJwmQw_SUM",
          "value": "计数:主订单编号"
          // value: "{\"text\":\"256\",\"formatString\":\"\",\"fldKey\":\"fldKwJwmQw_SUM\",\"groupKey\":\"256\"}"
        }
      ],
      "width": 100
    }
  ],
  "columnWidthConfigForRowHeader": [
    {
      "dimensions": [
        {
          "indicatorKey": "fldKwJwmQw_SUM",
          "value": "计数:主订单编号"
        }
      ],
      "width": 30
    }
  ],
  "rowHierarchyType": "grid",
  "columnHierarchyType": "grid"
}
tableInstance = new VTable.PivotTable(document.getElementById(CONTAINER_ID), option);
window['tableInstance'] = tableInstance;

Current Behavior

Expected Behavior

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions