1
0
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:
Allan Jardine 2012-08-08 16:27:42 +01:00
parent 320f53e217
commit 9c51aa0ad7
3 changed files with 4 additions and 6 deletions

View File

@ -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);
}

View File

@ -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",

View File

@ -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",