Skip to content

Instantly share code, notes, and snippets.

@asacarter
Last active August 29, 2015 14:20
Show Gist options
  • Save asacarter/c05fa3b71f8a8bd6239e to your computer and use it in GitHub Desktop.
Save asacarter/c05fa3b71f8a8bd6239e to your computer and use it in GitHub Desktop.
$(function() {
$('#example').dataTable({
processing: true,
serverSide: true,
ajax: {
url: API_URL + '?action=search_data',
data: function (d) {
d.key = 'value';
}
}
});
$('#example-select').on('change', function() {
// get the table
var table = $('#example').DataTable();
// add extra param to request
//table.ajax ......
// redraw
table.draw();
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment