@@ -18,42 +18,123 @@ Demo the Group list.
18
18
import { Table , Button } from ' @alifd/next' ;
19
19
20
20
const dataSource = [{
21
- price: ' US $2.45' ,
22
- status: 0 ,
21
+ price: ' US $1' ,
22
+ status: 1 ,
23
+ parent: ' root' ,
23
24
id: 1 ,
24
25
product: [{
25
26
title: ' 2014 New Fashion Novelty Tank Slim Women\' s Fashion Dresses With Lace' ,
26
27
avatar: ' https://sc01.alicdn.com/kf/HTB1ravHKXXXXXccXVXXq6xXFXXXJ/Chinese-Style-Fashion-Custom-Digital-Print-Silk.jpg_220x220.jpg'
27
28
}],
28
29
children: [{
29
- price: ' US $2.5 ' ,
30
- status: 1 ,
30
+ price: ' US $1-1 ' ,
31
+ status: 11 ,
31
32
id: 2 ,
33
+ parent: 0 ,
34
+ index: 0 ,
32
35
product: [{
33
36
title: ' Free shipping women Casual dresses lady dress plus size 2014' ,
34
37
avatar: ' https://sc02.alicdn.com/kf/HTB1efnNLVXXXXbtXpXXq6xXFXXXN/Light-100-acrylic-fashionabe-snood-shawl-weight.jpg_220x220.jpg'
35
38
}]
36
39
}, {
37
- price: ' US $2.5 ' ,
38
- status: 1 ,
40
+ price: ' US $1-2 ' ,
41
+ status: 12 ,
39
42
id: 3 ,
43
+ parent: 0 ,
44
+ product: [{
45
+ title: ' Free shipping women Casual dresses lady dress plus size 2014' ,
46
+ avatar: ' https://sc02.alicdn.com/kf/HTB1efnNLVXXXXbtXpXXq6xXFXXXN/Light-100-acrylic-fashionabe-snood-shawl-weight.jpg_220x220.jpg'
47
+ }]
48
+ }, {
49
+ price: ' US $1-3' ,
50
+ status: 13 ,
51
+ id: 7 ,
52
+ parent: 0 ,
40
53
product: [{
41
54
title: ' Free shipping women Casual dresses lady dress plus size 2014' ,
42
55
avatar: ' https://sc02.alicdn.com/kf/HTB1efnNLVXXXXbtXpXXq6xXFXXXN/Light-100-acrylic-fashionabe-snood-shawl-weight.jpg_220x220.jpg'
43
56
}]
44
57
}]
45
58
}, {
46
- price: ' US $2.5' ,
47
- status: 1 ,
59
+ price: ' US $3' ,
60
+ status: 3 ,
61
+ parent: ' root' ,
62
+ id: 3 ,
63
+ product: [{
64
+ title: ' 2014 New Fashion Novelty Tank Slim Women\' s Fashion Dresses With Lace' ,
65
+ avatar: ' https://sc01.alicdn.com/kf/HTB1ravHKXXXXXccXVXXq6xXFXXXJ/Chinese-Style-Fashion-Custom-Digital-Print-Silk.jpg_220x220.jpg'
66
+ }],
67
+ children: [{
68
+ price: ' US $3-1' ,
69
+ status: 31 ,
70
+ id: 31 ,
71
+ parent: 1 ,
72
+ index: 0 ,
73
+ product: [{
74
+ title: ' Free shipping women Casual dresses lady dress plus size 2014' ,
75
+ avatar: ' https://sc02.alicdn.com/kf/HTB1efnNLVXXXXbtXpXXq6xXFXXXN/Light-100-acrylic-fashionabe-snood-shawl-weight.jpg_220x220.jpg'
76
+ }]
77
+ }, {
78
+ price: ' US $3-2' ,
79
+ status: 32 ,
80
+ id: 32 ,
81
+ parent: 1 ,
82
+ product: [{
83
+ title: ' Free shipping women Casual dresses lady dress plus size 2014' ,
84
+ avatar: ' https://sc02.alicdn.com/kf/HTB1efnNLVXXXXbtXpXXq6xXFXXXN/Light-100-acrylic-fashionabe-snood-shawl-weight.jpg_220x220.jpg'
85
+ }]
86
+ }, {
87
+ price: ' US $3-3' ,
88
+ status: 33 ,
89
+ id: 33 ,
90
+ parent: 1 ,
91
+ product: [{
92
+ title: ' Free shipping women Casual dresses lady dress plus size 2014' ,
93
+ avatar: ' https://sc02.alicdn.com/kf/HTB1efnNLVXXXXbtXpXXq6xXFXXXN/Light-100-acrylic-fashionabe-snood-shawl-weight.jpg_220x220.jpg'
94
+ }]
95
+ }, {
96
+ price: ' US $3-4' ,
97
+ status: 34 ,
98
+ id: 34 ,
99
+ parent: 1 ,
100
+ product: [{
101
+ title: ' Free shipping women Casual dresses lady dress plus size 2014' ,
102
+ avatar: ' https://sc02.alicdn.com/kf/HTB1efnNLVXXXXbtXpXXq6xXFXXXN/Light-100-acrylic-fashionabe-snood-shawl-weight.jpg_220x220.jpg'
103
+ }]
104
+ }]
105
+ }, {
106
+ price: ' US $4' ,
107
+ status: 4 ,
108
+ parent: ' root' ,
48
109
id: 4 ,
49
110
product: [{
50
- title: ' Free shipping women Casual dresses lady dress plus size 2014 ' ,
51
- avatar: ' https://sc02 .alicdn.com/kf/HTB1efnNLVXXXXbtXpXXq6xXFXXXN/Light-100-acrylic-fashionabe-snood-shawl-weight .jpg_220x220.jpg'
111
+ title: ' 2014 New Fashion Novelty Tank Slim Women \' s Fashion Dresses With Lace ' ,
112
+ avatar: ' https://sc01 .alicdn.com/kf/HTB1ravHKXXXXXccXVXXq6xXFXXXJ/Chinese-Style-Fashion-Custom-Digital-Print-Silk .jpg_220x220.jpg'
52
113
}],
53
114
children: [{
54
- price: ' US $2.5' ,
55
- status: 1 ,
56
- id: 5 ,
115
+ price: ' US $4-1' ,
116
+ status: 31 ,
117
+ id: 31 ,
118
+ parent: 2 ,
119
+ index: 0 ,
120
+ product: [{
121
+ title: ' Free shipping women Casual dresses lady dress plus size 2014' ,
122
+ avatar: ' https://sc02.alicdn.com/kf/HTB1efnNLVXXXXbtXpXXq6xXFXXXN/Light-100-acrylic-fashionabe-snood-shawl-weight.jpg_220x220.jpg'
123
+ }]
124
+ }, {
125
+ price: ' US $4-2' ,
126
+ status: 32 ,
127
+ id: 32 ,
128
+ parent: 2 ,
129
+ product: [{
130
+ title: ' Free shipping women Casual dresses lady dress plus size 2014' ,
131
+ avatar: ' https://sc02.alicdn.com/kf/HTB1efnNLVXXXXbtXpXXq6xXFXXXN/Light-100-acrylic-fashionabe-snood-shawl-weight.jpg_220x220.jpg'
132
+ }]
133
+ }, {
134
+ price: ' US $4-3' ,
135
+ status: 33 ,
136
+ id: 33 ,
137
+ parent: 2 ,
57
138
product: [{
58
139
title: ' Free shipping women Casual dresses lady dress plus size 2014' ,
59
140
avatar: ' https://sc02.alicdn.com/kf/HTB1efnNLVXXXXbtXpXXq6xXFXXXN/Light-100-acrylic-fashionabe-snood-shawl-weight.jpg_220x220.jpg'
@@ -88,6 +169,20 @@ const dataSource = [{
88
169
}
89
170
};
90
171
172
+ const getCellProps = (rowIndex , colIndex , dataIndex , record ) => {
173
+ if (colIndex === 3 && record .index === 0 ) {
174
+ return {
175
+ rowSpan: dataSource[record .parent ].children .length
176
+ };
177
+ }
178
+
179
+ if (colIndex === 4 && record .index === 0 ) {
180
+ return {
181
+ rowSpan: dataSource[record .parent ].children .length
182
+ };
183
+ }
184
+ }
185
+
91
186
class App extends React .Component {
92
187
state = {
93
188
hasSelection: false
@@ -102,13 +197,13 @@ class App extends React.Component {
102
197
return (
103
198
< div>
104
199
< p>< Button onClick= {this .toggleGroupSelection }> Toggle GroupHeader Selection< / Button>< / p>
105
- < Table dataSource= {dataSource} rowSelection= {rowSelection}>
200
+ < Table dataSource= {dataSource} rowSelection= {rowSelection} getCellProps = {getCellProps} >
106
201
< Table .GroupHeader cell= {groupHeaderRender} hasChildrenSelection= {this .state .hasSelection }/ >
107
202
< Table .GroupFooter cell= {groupHeaderRender}/ >
108
203
< Table .Column cell= {productRender} title= " Product Details" dataIndex= " product" / >
109
204
< Table .Column cell= {priceRender} title= " Price" dataIndex= " price" width= {120 }/ >
110
205
< Table .Column cell= {statusRender} title= " Status" dataIndex= " status" width= {100 }/ >
111
- < Table .Column cell= {operRender} title= " " width= {100 }/ >
206
+ < Table .Column cell= {operRender} title= " Operation " width= {100 }/ >
112
207
< / Table>
113
208
< / div>
114
209
);
0 commit comments