-
-
Save a4amaan/daddc1a8209f78b01d77188707e041dc to your computer and use it in GitHub Desktop.
Custom parameters for jQuery Datatables with server-side processing
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
label | |
input#test-checkbox type="checkbox" | |
|Test checkbox | |
table#test-table | |
javascript: | |
$(document).ready(function() { | |
var table = $("#test-table").dataTable( { | |
"ajaxSource": '#{test_datatable_path}', | |
"serverSide": true, | |
"fnServerParams": function (aoData) { | |
aoData.push({name: "testCheckbox", value: $("#test-checkbox").is(":checked") }); | |
}, | |
"aoColumns": [ | |
{ "sTitle": 'Column 1', "name": 'column1'}, | |
{ "sTitle": 'Column 2', "name": 'column2'}, | |
{ "sTitle": 'Column 3', "name": 'column3', "orderable": false}, | |
], | |
}); | |
$('#test-checkbox').change( function() { table.fnDraw(); } ); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment