Buttons extension - getting data from datatable for a custom button?

Buttons extension - getting data from datatable for a custom button?

kerberonixkerberonix Posts: 7Questions: 5Answers: 0
edited January 2019 in Free community support

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?
}

Answers

  • kerberonixkerberonix Posts: 7Questions: 5Answers: 0

    I figured it out.

    "text": "Export",
    "action": function(e, dt, node, config) {
        console.log(dt.row().data());
    }
    
This discussion has been closed.