Boris Barabadze
Boris Barabadze

Reputation: 66

How to execute custom script on laravel-datatables?

I'm using Laravel datatables(https://github.com/yajra/laravel-datatables). I want to execute my custom script after processing datatables. I want to register event on one of rendering html dom element. how can I make it? I try

$(document).ready(function(){
    $('.someclass').on('change',function(){

    });
});`

but it dosn't work.

Upvotes: 2

Views: 1441

Answers (1)

Boris Barabadze
Boris Barabadze

Reputation: 66

https://datatables.net/reference/option/initComplete. Show an alert when the table has fully loaded

 $('#example').dataTable( {
      "initComplete": function(settings, json) {
        alert( 'DataTables has finished its initialisation.' );
      }
    } );

Upvotes: 2

Related Questions