Ich habe eine DataTable und Papierkorb-Symbol am "th". Ich muss die gesamte Spalte entfernen, wenn Sie auf das Papierkorb-Symbol klicken (Sie müssen alle Daten von allen Seiten entfernen). Ich habe versucht, den folgenden Code die aber nicht funktioniert unter pagination.Please mir helfen ...So entfernen Sie Spalte aus dataTable
$(document).on("click", ".a_datatbl_trash", function (e)
{
var indexToRemove = $(this).parent().index();
$("#datatable-buttons tbody tr").each(function() {
$(this).find("td:eq("+indexToRemove+")").remove();
});
$(this).closest("th").remove();
)};
Dies ist die HTML-Struktur
<thead>
<tr role="row">
<th class="sorting_asc" tabindex="0" aria-controls="datatable-buttons" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Article title: activate to sort column descending">Article title
<a href="" class="dragtable-drag-handle" style="background: none; width: 15px;"><i class="fa fa-fw fa-arrows"></i></a>
<a href="" class="a_datatbl_trash" style="float: right;"><i class="fa fa-fw fa-trash datatbl_trash" style="float: right;"></i></a>
</th>
</tr>
</thead>
Danke ... es funktioniert, wenn die Tabelle zuerst zerstört und aktualisiert .. – Ann
Ich bin froh, dass es hilft :) – Novy