language and scroll in search function
language and scroll in search function
grahn195
Posts: 2Questions: 1Answers: 0
Hello Guys!
how can i add the language and scrollY with full worked search in this code??
$(document).ready(function() {
// Setup - add a text input to each footer cell
$('#example tfoot th').each( function () {
var title = $(this).text();
$(this).html( '<input type="text" placeholder="Search '+title+'" />' );
} );
// DataTable
var table = $('#example').DataTable();
// Apply the search
table.columns().every( function () {
var that = this;
$( 'input', this.footer() ).on( 'keyup change', function () {
if ( that.search() !== this.value ) {
that
.search( this.value )
.draw();
}
} );
} );
} );
//Example code Language & scrollY
$('#example').DataTable( {
"language": {
"url": "//cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/German.json"
},
scrollY: '50vh',
scrollCollapse: true,
paging: false
} );
https://jsfiddle.net/sbqLe2v3/
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Do the filter initialisation inside
initComplete
. See thelanguage.url
reference for why this is required.Allan
didnt work!
https://jsfiddle.net/sbqLe2v3/1/
Uncaught SyntaxError: Unexpected identifier
Your code contains a syntax error as the console error is saying. There is a missing comma at the end of the
paging: 'false'
line.Also, that should be
paging: false
(i.e. not a string). Seepaging
for full documentation.Allan