Buttons extension - getting data from datatable for a custom button?
Buttons extension - getting data from datatable for a custom button?
![kerberonix](https://secure.gravatar.com/avatar/deda71d6edbab612745ec54950155bce/?default=https%3A%2F%2Fvanillicon.com%2Fdeda71d6edbab612745ec54950155bce_200.png&rating=g&size=120)
I need to create a custom button which manipulates the table data before export, however I'm not sure how I can access the data from the datatable?
I can achieve this using the built in copy button like this:
"extend": "copy",
"text": "Export",
"customize": function (data) {
// do stuff with data here, like
console.log(data);
}
is it possible to access that copy object (or whatever its called) for a custom button?
"text": "Export",
"action": function(e, dt, node, config) {
// how to get data here?
},
"customize": function (data) {
// or here?
}
This discussion has been closed.
Answers
I figured it out.