Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] 初始设置的冻结列大于 row 的 length,会报错 #2694

Closed
MadSummer opened this issue Oct 29, 2024 · 0 comments · Fixed by #2761
Closed

[Bug] 初始设置的冻结列大于 row 的 length,会报错 #2694

MadSummer opened this issue Oct 29, 2024 · 0 comments · Fixed by #2761
Assignees
Labels
bug Something isn't working

Comments

@MadSummer
Copy link

MadSummer commented Oct 29, 2024

Version

1.10.1

Link to Minimal Reproduction

https://visactor.io/vtable/demo/table-type/pivot-analysis-table?version=1.10.1
需要把代码编辑器放在下方
image
配置如下代码

fetch('https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/North_American_Superstore_Pivot_data.json')
  .then(res => res.json())
  .then(data => {
    const option = {
      frozenColCount:3,
      records: data,
      rows: [
        {
          dimensionKey: 'City',
          title: 'City',
          headerStyle: {
            textStick: true
          },
          width: 0
        }
      ],
      columns: [
        {
          dimensionKey: 'Category',
          title: 'Category',
          headerStyle: {
            textStick: true
          },
          width: 'auto'
        }
      ],
      indicators: [
        {
          indicatorKey: 'Quantity',
          title: 'Quantity',
          cellType:'progressbar',
          width: 'auto',
          showSort: false,
          headerStyle: {
            fontWeight: 'normal'
          },
          style: {
            padding: [16, 28, 16, 28],
            color(args) {
              if (args.dataValue >= 0) return 'black';
              return 'red';
            }
          }
        },
        {
          indicatorKey: 'Sales',
          title: 'Sales',
          width: 'auto',
          showSort: false,
          headerStyle: {
            fontWeight: 'normal'
          },
          format: rec => {
            return '$' + Number(rec).toFixed(2);
          },
          style: {
            padding: [16, 28, 16, 28],
            color(args) {
              if (args.dataValue >= 0) return 'black';
              return 'red';
            }
          }
        },
        {
          indicatorKey: 'Profit',
          title: 'Profit',
          width: 'auto',
          showSort: false,
          headerStyle: {
            fontWeight: 'normal'
          },
          format: rec => {
            return '$' + Number(rec).toFixed(2);
          },
          style: {
            padding: [16, 28, 16, 28],
            color(args) {
              if (args.dataValue >= 0) return 'black';
              return 'red';
            }
          }
        }
      ],
      corner: {
        titleOnDimension: 'row',
        headerStyle: {
          textStick: true
        }
      },
      dataConfig: {
        sortRules: [
          {
            sortField: 'Category',
            sortBy: ['Office Supplies', 'Technology', 'Furniture']
          }
        ]
      },
      widthMode: 'standard'
    };
    tableInstance = new VTable.PivotTable(document.getElementById(CONTAINER_ID), option);
    window['tableInstance'] = tableInstance;
  });

官网错误截图
image

Steps to Reproduce

这里判断是应该改一下,交叉表冻结列的 location 不一定是 rowHeader,如果初始设置的冻结裂大于 rows 的长度就可能是 body。导致找不到 define 从而报错
image

Current Behavior

image

Expected Behavior

正常运行

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@MadSummer MadSummer added the bug Something isn't working label Oct 29, 2024
@Rui-Sun Rui-Sun linked a pull request Nov 5, 2024 that will close this issue
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants