Created
August 16, 2018 17:57
-
-
Save ruslanpa/f6192f3b81d69eab817ddc4037149e0d 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 url = "/ajax/objects.txt"; | |
var table = $('#example').DataTable( { | |
"ajax": { | |
//url: "/ajax/objects.txt" | |
}, | |
data : [], | |
"columns": [ | |
{ "data": "name" }, | |
{ "data": "position" }, | |
{ "data": "office" }, | |
{ "data": "extn" }, | |
{ "data": "start_date" }, | |
{ "data": "salary" } | |
] | |
} ); | |
$('button').on('click', function() { | |
//console.log("button click:" + table.id); | |
//table.ajax.url("/ajax/objects.txt").load(); | |
table.ajax.url(url).load(); | |
}); | |
$('#reloadData').on('click', function() { | |
table.ajax.reload(); | |
}); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment