Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
44
rated 0 times [  45] [ 1]  / answers: 1 / hits: 21295  / 7 Years ago, wed, july 5, 2017, 12:00:00

In my react and ant.design based app, I've a table with the following columns.



const tableColumns = [{
title : 'Lorem',
dataIndex : 'lorem'
render: text => <a href='#'> {text + ipsum} </a>
}, {
title : 'Ipsum',
dataIndex : 'ipsum'
}];


I want to use value for ipsum i.e. the second column for each row inside render function of the first column. What's the best recommended way in ant.design to fetch second column's value here?


More From » arrays

 Answers
2

The second argument to the render function is the current record:



render: (text, row) => <a> {text + row.ipsum} </a>


https://ant.design/components/table/#Column


[#57210] Sunday, July 2, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
haden

Total Points: 638
Total Questions: 95
Total Answers: 99

Location: Burundi
Member since Wed, Nov 25, 2020
4 Years ago
;