Closed remolalata closed 5 years ago
Hi, I want to add a badge on my data on a datatable but when I'm using the Badge to style the data instead of showing the data its displaying the ticket.ticket_status
here is my code
const assembledTickets = props.tickets.map((ticket) => { return ( { ticket_id: ticket.ticket_id, ticket_summary: ticket.ticket_summary, duedate: ticket.duedate, orignal_duedate: ticket.original_duedate, logged_time: ticket.logged_time, ticket_status: <MDBBadge color="primary">ticket.ticket_status</MDBBadge> } ) }); const data = { columns: [ { label: 'Ticket ID', field: 'ticet_id' }, { label: 'Summary', field: 'ticket_summary' }, { label: 'Duedate', field: 'duedate' }, { label: 'Original Duedate', field: 'orignal_duedate' }, { label: 'Logged Time', field: 'logged_time' }, { label: 'Status', field: 'ticket_status' } ], rows: assembledTickets } return ( <MDBDataTable striped bordered data={data} /> )
Hi @remolalata ,
write ticket.ticket_status like this {ticket.ticket_status}
ticket.ticket_status
{ticket.ticket_status}
Hi, I want to add a badge on my data on a datatable but when I'm using the Badge to style the data instead of showing the data its displaying the ticket.ticket_status
here is my code