title: jquery Datatable: How can i pass the table row data to an onclick function
body: <p>I have a datatable that has a delete button, when click the delete button i want to pass the values in the row to my sever to delete and also delete in on the row when the server responds with a success. How can i achieve getting the value of the row to the onclick function and also the tr element so i can delete it.</p>
  
  <p><a href="https://i.stack.imgur.com/nwVxk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nwVxk.png" alt="enter image description here"></a> </p>
  
  <p>this is my present code:</p>
  
  <pre><code>model.initDataTable = function () {
  
      $('#datatables').DataTable({
  
          "processing": true,
          "serverSide": true,
          "ajax": {
              "url": "http://localhost:8080/admin/query/fibre",
              "data": function ( data ) {
                  //process data before sent to server.
              }},
          "columns": [
              { "data": "id", "name" : "ID", "title" : "ID"  },
              { "data": "name", "name" : "Name" , "title" : "Name"},
              { "class":"",
                  "orderable":      false,
                  "data":           null,
                  "defaultContent": "&lt;button id='dltBtn' type=\"button\" class=\"btn purple-gradient btn-sm\"&gt;Delete&lt;/button&gt;"},
              { "class":"",
                  "orderable":      false,
                  "data":           null,
                  "defaultContent": "&lt;button id='viewBtn' type=\"button\" class=\"btn purple-gradient btn-sm\"&gt;Delete&lt;/button&gt;"},
  
          ]
  
  
  
  
      } );
  
  
      $('#datatables tbody').on( 'click', '#dltBtn', function () {
  
  
  
      } );
  
  
  
  
  };
  </code></pre>