1

I have a react DataTable component like below:

<DataTable
     title="Your Tickets"
     columns={columns}
     style={{backgroundColor: '#000'}}
     data={tickets}
     pagination
     defaultSortAsc={false}
     defaultSortField="updated_at"
     customStyles={customStyles}                                        
                                    />

All i'm trying to achieve is when i click on a row, i want to show the ID of that specific row. How can i do that?

1 Answer 1

1

I'm not sure what you mean by "show". But you can get your id by onRowClicked.

    const handleRowClicked = row => {
        console.log(row.id)
    }

    <DataTable
        columns={columns}
        data={tickets}
        onRowClicked={handleRowClicked}
    />
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.