VisActor / VisActor/VTable

[Feature] 支持以行列key的形式上来设置单元格自定义样式

Open
#3,427 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
TypeScript
Stars
3.7k
Forks
486
Avg merge
1d 19h
Merged PRs (30d)
16

Description

What problem does this feature solve?

目前设置单元格自定义样式时,行列是数字序号,当ListTable的Tree模式下为单元格设置自定义样式的时候,tree的展开和收起会导致自定义样式漂移到其他单元格

Image

Image

Image

What does the proposed API look like?
const option = {
  customCellStyle: [
    {
      id: 'custom-1',
      style: {
        //...
      }
    },
  ],
  customCellStyleArrangement: [
    {
      customStyleId: 'custom-1',
      cellPosition: {
        col: 'a',
        row: 'row1'
      }
    },
    {
      customStyleId: 'custom-1',
      cellPosition: {
        col: ['b', 'c'],
        row: ['row2', 'row3'],
      }
    },
  ],
  records: [
    {
      field: 'row1',
      data:{
        col1: 1,
        col2: 2,
        col3: 3
      },
    },{
      field: 'row2',
      data:{
        col1: 1,
        col2: 2,
        col3: 3
      },
    }
  ],
  columns:[
    {
      field: 'col1',
      title: 'col 1'
    },{
      field: 'col2',
      title: 'col 2'
    },{
      field: 'col3',
      title: 'col 3'
    }
  ],
  widthMode: 'standard'
};

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing customCellStyle and customCellStyleArrangement handling in the TypeScript table implementation. Check how cell positions are resolved in ListTable tree mode, then verify that row and column keys, including arrays of keys, keep styles attached after expanding and collapsing nodes. Done means the proposed keyed API works without style drift.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.