How to render cell based on condition
One of the columns i have is Status which can only be number 0 , 1 , 2 and so on and i would like to render the description based on the number where 0 will be showing pending on the table 1 will show approved and 2 will show done, How can i achieve this ?
8 Replies
rival-black•2y ago
something like this?
harsh-harlequinOP•2y ago
yes!
let me try that
This example is based on style which is still helpfull
But i want to render div element
I found a solution
Thanks
rival-black•2y ago
great 👌
harsh-harlequinOP•2y ago
This is my solution below
harsh-harlequinOP•2y ago
@0xChupaCabra Please how can u achieve this since i don't have a column defined for the burger menu action ?

rival-black•2y ago
sorry, you want to have the burger in the same cell?
harsh-harlequinOP•2y ago
Yes
Thanks i have figured it out
yelping-magenta•2y ago
I your status example you can use the info.getValue() or destructure info to { getValue } as you have status as an accessor so you don't need to pick it up from info.row.original.status or even better if you want to sort by your mapped values later make the accessor a callback (row) => { switch here} and in the cell callback just have the span with getValue()