I have seen several working examples in jQuery but none in the context of React. So wanted this specific query raised.
I have a react Component Class which renders a datatable (as in datatables.net). I have added a View Button for each row in the datatable using column:defaultContent of datatable-Options.
I have written a class Method which is supposed to execute when the view Button is pressed.
The embedded HTML in columnDefault Option is
columns: [
{ "defaultContent":`<button onClick=${this.onView}>View</button>`},
{ data: "name" },
{ data: "email" },
{ data: "mobile", "defaultContent": "<i>Not set</i>" },
{ data: "landline", "defaultContent": "<i>Not set</i>"}
]
I can see that the Buttons are rendered.
The challenge is to get the onView method to execute with the specific recordId.