Created
August 21, 2015 10:28
-
-
Save cynx/5b838e660a8c5c6c2408 to your computer and use it in GitHub Desktop.
index.js - no vertical scroll
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 () { | |
$('#datatab tfoot th').each(function () { | |
$(this).html('<input type="text" />'); | |
}); | |
var oTable = $('#datatab').DataTable({ | |
"serverSide": true, | |
"ajax": { | |
"type": "POST", | |
"url": '/Home/DataHandler', | |
"contentType": 'application/json; charset=utf-8', | |
'data': function (data) { return data = JSON.stringify(data); } | |
}, | |
"scrollX": true, | |
"processing": true, | |
"paging": true, | |
"columns": [ | |
{ "data": "Name" }, | |
{ "data": "City" }, | |
{ "data": "Postal" }, | |
{ "data": "Email" }, | |
{ "data": "Company" }, | |
{ "data": "Account" }, | |
{ "data": "CreditCard" } | |
], | |
"order": [0, "asc"] | |
}); | |
oTable.columns().every(function () { | |
var that = this; | |
$('input', this.footer()).on('keyup change', function () { | |
that | |
.search(this.value) | |
.draw(); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment