Skip to content

Conversation

yesmeck
Copy link
Member

@yesmeck yesmeck commented Aug 20, 2016

#73

实现了基本的表头合并,还需要看看一些特殊情况的处理。

@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 74.206% when pulling 85ccb27 on yesmeck:grouping-columns into 62adccd on react-component:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.7%) to 74.349% when pulling 5429bc3 on yesmeck:grouping-columns into 62adccd on react-component:master.

@yesmeck
Copy link
Member Author

yesmeck commented Aug 21, 2016

A B
C D
E F
G H

要考虑这种情况吗,不知道怎么处理。

@afc163
Copy link
Member

afc163 commented Aug 21, 2016

可以不考虑。

@coveralls
Copy link

Coverage Status

Coverage increased (+2.1%) to 75.78% when pulling e4cae1d on yesmeck:grouping-columns into 62adccd on react-component:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+2.1%) to 75.78% when pulling 5e1e2ed on yesmeck:grouping-columns into 62adccd on react-component:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+2.1%) to 75.78% when pulling 5e1e2ed on yesmeck:grouping-columns into 62adccd on react-component:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+2.1%) to 75.78% when pulling 881f149 on yesmeck:grouping-columns into 62adccd on react-component:master.

@yesmeck
Copy link
Member Author

yesmeck commented Aug 22, 2016

发现 fixed column 也不好处理:

姓名 其它
年龄 住址

这种情况下如果“姓名”是固定的,左边的 fixed table 的头部生成出来就是这样的:

<thead>
  <tr>
    <th rowspan="2">姓名</th>
  </tr>
</thead>

但是因为只有一行,所以rowspan就会失效。想要rowspan有效,就要补一行:

<thead>
  <tr>
    <th rowspan="2">姓名</th>
    <th>.</th>
  </tr>
  <tr>
    <th>.</th>
  </tr>
</thead>

但是好像没好的办法把这补的部分隐藏起来,把它设为display: none也是会让rowspan失效。

看了下 ag-grid,它的表格是用 div 来实现的,所以比较容易处理这种情况。

@benjycui
Copy link
Member

如果我没理解错,应该可以通过设置 height 的方式实现?

<thead>
  <tr>
    <th height={100}>姓名</th>
  </tr>
</thead>

@yesmeck
Copy link
Member Author

yesmeck commented Aug 23, 2016

@benjycui 嗯,用 height 搞定了,我的做法是给<th rowspan="2">加一个.rc-table-rowspan-2的 class。不过这样的问题是 css 需要先定义好,我先定义了 10 个,也就是说rowspan最多只能到 10。

@coveralls
Copy link

Coverage Status

Coverage increased (+6.6%) to 80.287% when pulling b24f30f on yesmeck:grouping-columns into 62adccd on react-component:master.

@yesmeck
Copy link
Member Author

yesmeck commented Aug 23, 2016

columnsPageSize 已经 deprecated 了还要去支持它吗?不知道打算什么时候移除。

@coveralls
Copy link

Coverage Status

Coverage increased (+6.6%) to 80.287% when pulling f605139 on yesmeck:grouping-columns into 62adccd on react-component:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+6.7%) to 80.322% when pulling ba3327c on yesmeck:grouping-columns into 62adccd on react-component:master.

@yesmeck yesmeck changed the title [WIP]Grouping columns Grouping columns Aug 23, 2016
@yesmeck
Copy link
Member Author

yesmeck commented Aug 23, 2016

@afc163 @benjycui 如果不需要处理columnsPageSize的话,有空可以 review 下。

@coveralls
Copy link

Coverage Status

Coverage increased (+6.7%) to 80.322% when pulling fbdbbde on yesmeck:grouping-columns into 62adccd on react-component:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+6.7%) to 80.322% when pulling ec609e3 on yesmeck:grouping-columns into 62adccd on react-component:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+6.7%) to 80.322% when pulling 0ec229b on yesmeck:grouping-columns into 62adccd on react-component:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+6.7%) to 80.322% when pulling 0ec229b on yesmeck:grouping-columns into 62adccd on react-component:master.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 5b23cc4 on yesmeck:grouping-columns into * on react-component:master*.

@afc163
Copy link
Member

afc163 commented Aug 23, 2016

太给力了!:+1: 我这周晚点时候看下

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 67e58b7 on yesmeck:grouping-columns into * on react-component:master*.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 0191cba on yesmeck:grouping-columns into * on react-component:master*.

@afc163 afc163 merged commit ca79e08 into react-component:master Aug 30, 2016
@yesmeck
Copy link
Member Author

yesmeck commented Sep 2, 2016

ant-design 那边要 PR 到 master 吗?

@afc163
Copy link
Member

afc163 commented Sep 2, 2016

先不用,等这边重构一下。

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants