mirror of
https://github.com/DataTables/DataTables.git
synced 2025-02-20 18:54:15 +01:00
Dev fix: DataTables/DataTables #250
- Need to namespace custom DataTables events in 1.10
This commit is contained in:
parent
4549646891
commit
667ee39fdb
@ -1 +1 @@
|
|||||||
7d8d52c60c66a7a672833810278db0d19ebd3ad9
|
ede390881112840a62002ab284e63c1a2e09a6fa
|
||||||
|
@ -26,9 +26,9 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$('#example')
|
$('#example')
|
||||||
.on( 'order', function () { eventFired( 'order' ); } )
|
.on( 'order.dt', function () { eventFired( 'Order' ); } )
|
||||||
.on( 'search', function () { eventFired( 'Filter' ); } )
|
.on( 'search.dt', function () { eventFired( 'Search' ); } )
|
||||||
.on( 'page', function () { eventFired( 'Page' ); } )
|
.on( 'page.dt', function () { eventFired( 'Page' ); } )
|
||||||
.dataTable();
|
.dataTable();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
@ -42,8 +42,15 @@ $(document).ready(function() {
|
|||||||
<h1>DataTables example <span>- DataTables events</span></h1>
|
<h1>DataTables example <span>- DataTables events</span></h1>
|
||||||
|
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<p>DataTables fires a number of custom events which you can bind to in the standard jQuery fashion,
|
<p>DataTables fires a number of custom events which you can bind to in the standard jQuery fashion
|
||||||
allowing your code to perform custom actions when these events occur.</p>
|
(although note that the namespace <code>dt</code> <em>must</em> be used), allowing your code to perform
|
||||||
|
custom actions when these events occur.</p>
|
||||||
|
|
||||||
|
<p>All custom events fired by DataTables are fired with the namespace <code>dt</code> in order to
|
||||||
|
prevent conflicts arising with other jQuery plug-ins which also fire events. The DataTables <a href=
|
||||||
|
"//datatables.net/api/on%28%29"><code class="api" title="API method">on()</code></a> method can be used
|
||||||
|
like the jQuery <code>on()</code> method, but will automatically append the <code>dt</code> namespace
|
||||||
|
if required.</p>
|
||||||
|
|
||||||
<p>This example shows the use of the <a href="//datatables.net/event/sort"><code class="event" title=
|
<p>This example shows the use of the <a href="//datatables.net/event/sort"><code class="event" title=
|
||||||
"Event">sort</code></a>, <a href="//datatables.net/event/search"><code class="event" title=
|
"Event">sort</code></a>, <a href="//datatables.net/event/search"><code class="event" title=
|
||||||
@ -556,9 +563,9 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$('#example')
|
$('#example')
|
||||||
.on( 'order', function () { eventFired( 'order' ); } )
|
.on( 'order.dt', function () { eventFired( 'Order' ); } )
|
||||||
.on( 'search', function () { eventFired( 'Filter' ); } )
|
.on( 'search.dt', function () { eventFired( 'Search' ); } )
|
||||||
.on( 'page', function () { eventFired( 'Page' ); } )
|
.on( 'page.dt', function () { eventFired( 'Page' ); } )
|
||||||
.dataTable();
|
.dataTable();
|
||||||
} );
|
} );
|
||||||
</pre>
|
</pre>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user