mirror of
https://github.com/DataTables/DataTables.git
synced 2025-01-18 11:52:11 +01:00
New: xhr event
This commit is contained in:
parent
320f53e217
commit
9c51aa0ad7
@ -2694,12 +2694,10 @@ var dtLinks = [
|
||||
/* Show and syntax highlight XHR returns from the server */
|
||||
$(document).ready( function () {
|
||||
if ( $.fn.dataTableSettings.length >= 1 ) {
|
||||
$('#example').dataTable().bind('xhr', function ( e, oSettings ) {
|
||||
$('#example').dataTable().bind('xhr', function ( e, oSettings, json ) {
|
||||
var n = document.getElementById('latest_xhr');
|
||||
if ( n ) {
|
||||
n.innerHTML = JSON.stringify(
|
||||
JSON.parse(oSettings.jqXHR.responseText), null, 2
|
||||
);
|
||||
n.innerHTML = JSON.stringify( json, null, 2 );
|
||||
n.className = "brush: js;"
|
||||
SyntaxHighlighter.highlight({}, n);
|
||||
}
|
||||
|
2
media/js/jquery.dataTables.js
vendored
2
media/js/jquery.dataTables.js
vendored
@ -8689,7 +8689,7 @@
|
||||
oSettings.oApi._fnLog( oSettings, 0, json.sError );
|
||||
}
|
||||
|
||||
$(oSettings.oInstance).trigger('xhr', oSettings);
|
||||
$(oSettings.oInstance).trigger('xhr', [oSettings, json]);
|
||||
fnCallback( json );
|
||||
},
|
||||
"dataType": "json",
|
||||
|
@ -922,7 +922,7 @@ DataTable.defaults = {
|
||||
oSettings.oApi._fnLog( oSettings, 0, json.sError );
|
||||
}
|
||||
|
||||
$(oSettings.oInstance).trigger('xhr', oSettings);
|
||||
$(oSettings.oInstance).trigger('xhr', [oSettings, json]);
|
||||
fnCallback( json );
|
||||
},
|
||||
"dataType": "json",
|
||||
|
Loading…
x
Reference in New Issue
Block a user