Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- var my_results = $("#my_table").DataTable({
- "processing": true,
- "serverSide": true,
- "ajax": {
- "url": "/my-internal-api-endpoint/",
- "data": function ( d ) {
- d.eventKey = $("#myInput option:selected").val();
- d.specKey = 0; // <- This is value which need to be changed
- }
- },
- "columns": [
- { "data": "date" },
- { "data": "event" }
- ],
- "fnInitComplete": function(oSettings, json) {
- $('#foo').val(json.foo);
- $('#bar').val(json.bar);
- }
- });
- $('.myClass').on('click', function(){
- var yoo = $(this).val();
- my_results.ajax.data({specKey: yoo}); // <- There is a problem
- my_results.ajax.reload();
- });
- $("#myInput").on('change', function() {
- my_results.ajax.reload();
- });
- });
Add Comment
Please, Sign In to add comment