Closed andreguilhon closed 5 years ago
Ok, for anyone who gets here, that is how I solved it:
responsive="true"
id="robot-event-list"
columns={ [ {title: "Robô", data: "robot_name"},
{title:"Tipo de comando", data: "command_type"},
{title: "Validade inicial", data: "valid_from"},
{title: "Validade final", data: "valid_until"},
{title: "Data da execução", data: "execution_date"},
{title: 'Actions', data: null, render: () => <Button text="Action" className="on-click-eveent" /> }
] }
options={{
select: false,
rowId: "browser",
}}
data = { items }
onClickEvents={{
onClickEveent: (data, rowIdx, rowData) => {
alert(data.robot_name);
}
}}
/>```
className and the name of the function in the onClickEvents must be the same!
Thanks to https://github.com/sd1337/adminlte-2-react-examples which had a working example!
Hello, I'm trying to write a DataTable to show records that I fetched from some API. I can list it without problems. My next desired step would be to put a button to delete the item listed. Although I could show the button, I can't make the onClick event on that button work. The code I'm using is bellow.
How can I make it work?