This is the first time using Datatable in ReactJS and in my API I have columns with sub-rows, which I do not know how to do it. And there are no examples available. If anyone can help me out with some advice, I will really appreciate it. Thanks!
This is what I did so far:
const columns = [
{
name: "Identification",
selector: row => row.Identification,
},
{
name: "Sequence Number",
selector: row => row.SequenceNumber,
},
{
name: "Name",
selector: row => row.Name,
},
{
name: "Type",
selector: row => row.Type,
},
{
name: "Photo",
selector: row => <img height="30px" width="30px" alt={row.Identification} src={row.Photo} />
},
{
name: "Customer Segment",
selector: row => row.CustomerSegment,
cell: (d) => <span>{d.CustomerSegment.join(", ")}</span>,
},
{
name: "Service and Facility",
selector: row => row.ServiceAndFacility,
},
{
name: "Accessibility",
selector: row => row.Accessibility,
},
{
name: "Other Service and Facility",
selector: row => row.OtherServiceAndFacility,
},
This is how it looks like in the API: