Skip to content

Instantly share code, notes, and snippets.

@ShaneCunn
Created March 20, 2018 20:48
Show Gist options
  • Save ShaneCunn/771e36a57e0347114be17d0a604f82ac to your computer and use it in GitHub Desktop.
Save ShaneCunn/771e36a57e0347114be17d0a604f82ac to your computer and use it in GitHub Desktop.
$(document).ready(function () {
var dataTable = $('#employee-grid').DataTable({
"responsive": true,
"processing": true,
"serverSide": true,
"ajax": {
url: "ajax/response.php", // json datasource
data: {action: 'getEMP'}, // Set the POST variable called action to contain getEMP
type: 'post', // method , by default get
},
error: function () { // error handling
$(".employee-grid-error").html("");
$("#employee-grid").append('<tbody class="employee-grid-error"><tr><th colspan="3">No data found in the server</th></tr></tbody>');
$("#employee-grid_processing").css("display", "none");
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment