Merge branch 'master' of github.com:DataTables/DataTablesSrc

This commit is contained in:
Allan Jardine
2020-05-21 09:56:41 +00:00
parent a0aefd5ef6
commit 15978fa6b5
4 changed files with 51 additions and 43 deletions

View File

@@ -32,20 +32,23 @@ $(document).ready(function() {
} );
// DataTable
var table = $('#example').DataTable();
var table = $('#example').DataTable({
initComplete: function () {
// Apply the search
this.api().columns().every( function () {
var that = this;
// Apply the search
table.columns().every( function () {
var that = this;
$( 'input', this.footer() ).on( 'keyup change clear', function () {
if ( that.search() !== this.value ) {
that
.search( this.value )
.draw();
}
} );
} );
}
});
$( 'input', this.footer() ).on( 'keyup change clear', function () {
if ( that.search() !== this.value ) {
that
.search( this.value )
.draw();
}
} );
} );
} );
@@ -66,7 +69,9 @@ $(document).ready(function() {
<p>This examples shows text elements being used with the <a href="//datatables.net/reference/api/column().search()"><code class="api" title=
"DataTables API method">column().search()</code></a> method to add input controls in the footer of the table for each column. Note that the
<code>*index*:visible</code> option is used for the column selector to ensure that the <a href="//datatables.net/reference/api/column()"><code class="api" title=
"DataTables API method">column()</code></a> method takes into account any hidden columns when selecting the column to act upon.</p>
"DataTables API method">column()</code></a> method takes into account any hidden columns when selecting the column to act upon. <a href=
"//datatables.net/reference/option/initComplete"><code class="option" title="DataTables initialisation option">initComplete</code></a> is used to allow for any
asynchronous actions, such as Ajax loading of data or language information.</p>
</div>
<div class="demo-html"></div>
<table id="example" class="display" style="width:100%">
@@ -566,20 +571,23 @@ $(document).ready(function() {
} );
// DataTable
var table = $('#example').DataTable();
var table = $('#example').DataTable({
initComplete: function () {
// Apply the search
this.api().columns().every( function () {
var that = this;
// Apply the search
table.columns().every( function () {
var that = this;
$( 'input', this.footer() ).on( 'keyup change clear', function () {
if ( that.search() !== this.value ) {
that
.search( this.value )
.draw();
}
} );
} );
}
});
$( 'input', this.footer() ).on( 'keyup change clear', function () {
if ( that.search() !== this.value ) {
that
.search( this.value )
.draw();
}
} );
} );
} );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul>