It does. However, you probably have the event listener being attached after the initialisation? In which case it will have already triggered - e.g. ( https://live.datatables.net/sijecuve/1/edit ):
let dt = new DataTable('#example');
dt.on('draw', () => {
console.log('Doing draw');
});
The on() call is made after the table has done its initial draw. It does work if you use ajax though since that makes the initialisation async.
Answers
It does. However, you probably have the event listener being attached after the initialisation? In which case it will have already triggered - e.g. ( https://live.datatables.net/sijecuve/1/edit ):
The
on()
call is made after the table has done its initial draw. It does work if you useajax
though since that makes the initialisation async.With DataTables 2.3 there is a new
on
option to resolve exactly this issue ( https://live.datatables.net/sijecuve/2/edit ):on
will attach the listeners based on its keys at the start of the initialisation process.Allan