title: Create a delete button in DataTable with Ajax query
body: <p>I'm trying to create a delete button in my DataTable which deletes data from a database.</p>
  <p>I have created the icon button, but I don't know how to insert a 'delete' function in to the DataTable.</p>
  <p>I think I have to use an AJAX request to call PHP to delete the row in the DataTable. I have tried some stuff, but nothing works.</p>
  <pre class="lang-js prettyprint-override"><code>$(&quot;#tab&quot;).dataTable({
    serverSide: false,
    ajax: {
      type: &quot;GET&quot;,
      url: plugin_ajax_object.ajax_url,
      dataSrc: &quot;&quot;, // Aller sur un fichier php pour aovir une url
    },
    columns: [
      { data: &quot;david_enable&quot;, },
      { data: &quot;david_nom&quot;, },
      { data: &quot;david_url&quot;, },
      { data: &quot;david_cms&quot;, },
      {
        data: &quot;david_site_id&quot;,
        render: function(data, type, row) {
          return `&lt;a href=&quot;admin.php?page=enable.php${data}&quot; class=&quot;dashicons-before dashicons-edit&quot;&gt;Activer&lt;/a&gt;&lt;br&gt;
            &lt;a class=&quot;dashicons-before dashicons-trash&quot; id=&quot;Delete&quot;&gt;Supprimer&lt;/a&gt;&lt;br&gt;`
        }
      }
    ],
    createdRow: function(row, data, dataIndex) {
      if (data[&quot;david_enable&quot;] == null) {
        $(row).addClass('bg-danger');
      }
    },
    createdRow: function(row, data, dataIndex) {},
    language: {
      lengthMenu: &quot;Afficher _MENU_ éléments&quot;,
      search: &quot;Rechercher :&quot;,
      info: &quot;Affichage de l'élément _START_ à _END_ sur _TOTAL_ éléments&quot;,
      paginate: {
        first: &quot;Premier&quot;,
        last: &quot;Dernier&quot;,
        next: &quot;Suivant&quot;,
        previous: &quot;Précédent&quot;,
      },
      infoEmpty: &quot;&quot;,
      emptyTable: &quot;&quot;,
      zeroRecords: &quot;&quot;,
      loadingRecords: &quot;Chargement...&quot;,
      processing: &quot;En cours...&quot;,
    },
    pagingType: &quot;simple_numbers&quot;,
    lengthMenu: [10, 20, 30],
    pageLength: 10,
  });
  </code></pre>