mirror of
https://github.com/DataTables/DataTables.git
synced 2025-02-27 00:54:15 +01:00
Update - example: Use initComplete for column filter example
This commit is contained in:
parent
f26ec6052f
commit
05414e1437
@ -1 +1 @@
|
|||||||
7a4382d11a7db5cae5e4b9311564c741b70c7dfd
|
6bda0abd0cade0b2795f938b2a1d1686c3176024
|
||||||
|
@ -32,10 +32,10 @@ $(document).ready(function() {
|
|||||||
} );
|
} );
|
||||||
|
|
||||||
// DataTable
|
// DataTable
|
||||||
var table = $('#example').DataTable();
|
var table = $('#example').DataTable({
|
||||||
|
initComplete: function () {
|
||||||
// Apply the search
|
// Apply the search
|
||||||
table.columns().every( function () {
|
this.api().columns().every( function () {
|
||||||
var that = this;
|
var that = this;
|
||||||
|
|
||||||
$( 'input', this.footer() ).on( 'keyup change clear', function () {
|
$( 'input', this.footer() ).on( 'keyup change clear', function () {
|
||||||
@ -46,6 +46,9 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
} );
|
} );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
|
||||||
@ -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=
|
<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
|
"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=
|
<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>
|
||||||
<div class="demo-html"></div>
|
<div class="demo-html"></div>
|
||||||
<table id="example" class="display" style="width:100%">
|
<table id="example" class="display" style="width:100%">
|
||||||
@ -566,10 +571,10 @@ $(document).ready(function() {
|
|||||||
} );
|
} );
|
||||||
|
|
||||||
// DataTable
|
// DataTable
|
||||||
var table = $('#example').DataTable();
|
var table = $('#example').DataTable({
|
||||||
|
initComplete: function () {
|
||||||
// Apply the search
|
// Apply the search
|
||||||
table.columns().every( function () {
|
this.api().columns().every( function () {
|
||||||
var that = this;
|
var that = this;
|
||||||
|
|
||||||
$( 'input', this.footer() ).on( 'keyup change clear', function () {
|
$( 'input', this.footer() ).on( 'keyup change clear', function () {
|
||||||
@ -580,6 +585,9 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
} );
|
} );
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
} );</code>
|
} );</code>
|
||||||
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
|
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
|
||||||
<ul>
|
<ul>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user