Created
March 20, 2018 20:48
-
-
Save ShaneCunn/771e36a57e0347114be17d0a604f82ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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