I have a dataTable and having trash icon at the "th". I need to remove entire column when click on the trash icon(need to remove all data from all pages). I tried the following code but which is not working under pagination.Please help me...
$(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();
)};
This is the html structure
<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>