1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-03-15 16:29:16 +01:00

Shorter way to get the column title

I'd be happy for the change to be released under the MIT license ;)
This commit is contained in:
Allan Jardine 2015-11-17 11:13:58 +00:00
parent 021f0d0c7d
commit 4d25479434
2 changed files with 3 additions and 3 deletions

View File

@ -1 +1 @@
9780a3693572757d87bf70e48bd7555faf974f28
700b2ea95e09f82b63962595edc78f25313ac925

View File

@ -31,7 +31,7 @@
$(document).ready(function() {
// Setup - add a text input to each footer cell
$('#example tfoot th').each( function () {
var title = $('#example thead th').eq( $(this).index() ).text();
var title = $(this).text();
$(this).html( '<input type="text" placeholder="Search '+title+'" />' );
} );
@ -564,7 +564,7 @@ $(document).ready(function() {
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
// Setup - add a text input to each footer cell
$('#example tfoot th').each( function () {
var title = $('#example thead th').eq( $(this).index() ).text();
var title = $(this).text();
$(this).html( '&lt;input type=&quot;text&quot; placeholder=&quot;Search '+title+'&quot; /&gt;' );
} );