Two buttons in a row with columDefs and render

Two buttons in a row with columDefs and render

neelsfneelsf Posts: 15Questions: 6Answers: 1
edited March 2019 in Free community support

I get one column with a button to work 100% and pass variables to the url etc. How do one add a 2nd button in the same row, to open a different form with the same variables in the URL . I just love datatables, but this problem has flattened me for days now.

"columnDefs": [ {    "className": "dt-body-center", "targets": "_all",
  
  
            "targets": [0,1]
                          "render": function ( data, type, row ) {
                        return '<a class="btn btn-info btn-sm" href="transact/rdmicn1.php?update=1&demandercode=' + row[2]  + ' &facility=' + row[1]  + ' &order_no=' + row[4] + ' ">' + data + 'Save RDM file</a>';

return '<a class="btn btn-info btn-sm" href="transact/rdmicn2.php?update=1&demandercode=' + row[2]  + ' &facility=' + row[1]  + ' &order_no=' + row[4] + ' ">' + data + 'Submit to Depot</a>';
                        }

                        
                        } ],

EDIT: Updated to use Markdown Code formatting.

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.