Skip to content

Instantly share code, notes, and snippets.

@aziz-blr
Last active August 1, 2017 08:36
Show Gist options
  • Save aziz-blr/d51e1378bba7b4131af1c590a8666755 to your computer and use it in GitHub Desktop.
Save aziz-blr/d51e1378bba7b4131af1c590a8666755 to your computer and use it in GitHub Desktop.
JQuery Data Table Set Up
var selected = [];
$(function () {
$('#emailTemplatesDataTable').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": false,
order: [[0, 'DESC']],
columnDefs: [
{ orderable: false, targets: 0 },
{ orderable: false, targets: 1 },
{ orderable: false, targets: 2 },
{ orderable: false, targets: 3 },
{ "width": "5%", "targets": 2 },
{ "width": "10%", "targets": 3 },
{ "className": "dt-center", "targets": 2 },
{ "className": "dt-center", "targets": 3 }
],
"drawCallback": function (settings) {
$("#emailTemplatesDataTable").wrap("<div class='table-responsive'></div>");
$('[data-toggle=confirmation]').confirmation({
rootSelector: '[data-toggle=confirmation]'
});
},
"fnRowCallback": function( nRow, aData) {
$(nRow).attr("rowid", aData[4]);
return nRow;
},
"bProcessing": true,
"serverSide": true,
"language": {
"processing": '<img src="<?php echo BACKEND_URL; ?>/images/lazy-loader.gif">'
},
"ajax":{
url :"ajax/response_email_template.php",
type: "post"
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment