How to draw button with onClick event in row Datatables with ReactJS

How to draw button with onClick event in row Datatables with ReactJS

erickwperickwp Posts: 1Questions: 1Answers: 0

I have data in datatables an every row result data, I want to add edit button and I add onclick event, but the button can't call the function. Any solution ?
I'm using datatables in ReactJS

Here's my code

{
    'aTargets': [4],
    'mRender': function (data, type, full) {
        return `<button type="button" onclick="btnEdit()"><i class="fa fa-edit"></i></button>`
    }
}

Thanks before!

Answers

  • colincolin Posts: 8,033Questions: 0Answers: 1,349

    Is that with Editor? We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

Sign In or Register to comment.