Question: How to extend initComplete Datatables ?

Question

How to extend initComplete Datatables ?

Answers 1
Added at 2017-01-03 08:01
Tags
Question
$('#example').dataTable( {
  "initComplete": function(settings, json) {
      alert( 'DataTables has finished its initialisation.' );
  }
} );

How to extends initComplete like oLanguange ?

$.extend( true, $.fn.dataTable.defaults.oLanguage, {
 "sSearch": "<label>Record per page</label> _INPUT_ "
});
Answers
nr: #1 dodano: 2017-01-05 10:01
$(document).on( 'init.dt', function ( e, settings ) {
    var api = new $.fn.dataTable.Api( settings );

    if ( api.init().pageResize ||
         $.fn.dataTable.defaults.pageResize )
    {
        new PageResize( api );
   }
} );

Reference: https://datatables.net/reference/api/init()

Source Show
◀ Wstecz