@@ -6,28 +6,22 @@ export default class ResultTable extends React.Component {
6
6
constructor ( props ) {
7
7
super ( props ) ;
8
8
this . state = {
9
- rows :
[ { "id" :
1 , "first_name" :
"William" , "last_name" :
"Elliott" , "email" :
"[email protected] " ,
10
- "country" :"Argentina" , "ip_address" :"247.180.226.89" } ,
11
- { "id" :
2 , "first_name" :
"Carl" , "last_name" :
"Ross" , "email" :
"[email protected] " ,
12
- "country" :"South Africa" , "ip_address" :"27.146.70.36" } ,
13
- { "id" :
3 , "first_name" :
"Jeremy" , "last_name" :
"Scott" , "email" :
"[email protected] " ,
14
- "country" :"Colombia" , "ip_address" :"103.52.74.225" } ]
9
+ rows : [ { "text" :"weather" , "translations" :[ "Wetter" , "Another" ] } ]
15
10
} ;
16
11
}
17
12
18
13
render ( ) {
19
- return < Layout > < Table
20
- height = { 40 + ( ( this . state . rows . length + 1 ) * 30 ) }
21
- width = { 1150 }
22
- rowsCount = { this . state . rows . length }
23
- rowHeight = { 30 }
24
- headerHeight = { 30 }
25
- rowGetter = { function ( rowIndex ) { return this . state . rows [ rowIndex ] ; } . bind ( this ) } >
26
- < Column dataKey = "id" width = { 50 } label = "Id" />
27
- < Column dataKey = "first_name" width = { 200 } label = "First Name" />
28
- < Column dataKey = "last_name" width = { 200 } label = "Last Name" />
29
- < Column dataKey = "email" width = { 400 } label = "e-mail" />
30
- < Column dataKey = "country" width = { 300 } label = "Country" />
31
- </ Table > </ Layout > ;
14
+ return < Layout >
15
+ < Table height = { 40 + ( ( this . state . rows . length + 1 ) * 30 ) }
16
+ width = { 1150 }
17
+ rowsCount = { this . state . rows . length }
18
+ rowHeight = { 30 }
19
+ headerHeight = { 30 }
20
+ rowGetter = { function ( rowIndex ) { return this . state . rows [ rowIndex ] ; } . bind ( this ) } >
21
+ < Column dataKey = "text" width = { 300 } label = "Text" />
22
+ < Column dataKey = "translations" width = { 850 } label = "Translations"
23
+ cellRenderer = { cellData => cellData . join ( ) } />
24
+ </ Table >
25
+ </ Layout > ;
32
26
}
33
27
}
0 commit comments