mirror of
https://github.com/DataTables/DataTables.git
synced 2024-11-29 11:24:10 +01:00
Dev: Remove the static construct
method that had been added as part of 1.10
- I added a static DataTable.on() method previously in the 1.10 development for a single event called `construct` which would tell us when a table was constructed. But I've realise that since the events that DataTables' triggers bubble up through the document, that effect can already be achieved: - Use: - $(document).on( 'init.dt', function ( e, settings ) { } ); - Rather than: - $.fn.dataTable.on( 'construct', function ( settings ) { } ); - No backwards compatiblity issues as the DataTable.on code was never shipped, its dev code only
This commit is contained in:
parent
0f18491cf1
commit
635a027057
@ -1 +1 @@
|
|||||||
4adf77363c60f233d2674e2eb2706032270c1839
|
1f561e301a608c35535bc0e0e3496d4440225830
|
||||||
|
33
media/js/jquery.dataTables.js
vendored
33
media/js/jquery.dataTables.js
vendored
@ -3003,10 +3003,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
_fnCallbackFire( settings, 'aoInitComplete', 'init', [settings, json] );
|
_fnCallbackFire( settings, 'aoInitComplete', 'init', [settings, json] );
|
||||||
|
|
||||||
$.each( DataTable._initQueue, function ( i, fn ) {
|
|
||||||
fn( settings );
|
|
||||||
} );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -8283,35 +8279,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Private property used for sorting the construct event listeners
|
|
||||||
DataTable._initQueue = [];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Listen for a static event from DataTables. Currently only one event is
|
|
||||||
* available: `construct` which is fired whenever a new table is created. This
|
|
||||||
* is for plug-ins to be able to automatically initialise themselves when a
|
|
||||||
* table is created.
|
|
||||||
*
|
|
||||||
* @param {string} ev Event to listen for. Currently only `construct` is
|
|
||||||
* available.
|
|
||||||
* @param {function} fn Function to be executed on event occurrence. A single
|
|
||||||
* parameter is passed in, the settings object for the new table.
|
|
||||||
* @static
|
|
||||||
* @dtopt API-Static
|
|
||||||
*
|
|
||||||
* @example
|
|
||||||
* $.fn.dataTable.on( 'construct', function ( settings ) {
|
|
||||||
* alert( 'A new table was created' );
|
|
||||||
* } );
|
|
||||||
*/
|
|
||||||
DataTable.on = function ( ev, fn )
|
|
||||||
{
|
|
||||||
if ( ev === 'construct' ) {
|
|
||||||
DataTable._initQueue.push( fn );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user