Front-end callbacks

Contents

wpDataTable Front-end callbacks

JavaScript hooks for customizing the table layout

The front-end (JS) part of wpDataTables plays a significant role in the plugin’s functionality. Generally, front-end rendering is done by the DataTables jQuery plugin, but wpDataTables introduces some callbacks of its own.

All wpDataTables existing on the page are reflected in the global JavaScript object called ‘wpDataTables‘. If you check this variable in the JS developer console you will see the wpDataTables as properties of this object:

 

addOnDrawCallback( function callback() );

To assign a simple function to the redraw event we can use e.g. this jQuery snippet: