-
-
Save codesharpdev/e60f673d4a64982dba9ece403ec6e637 to your computer and use it in GitHub Desktop.
index.js - no vertical scroll
This file contains hidden or 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