2

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.

1 Answer 1

2

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.' );
      }
    } );

Sign up to request clarification or add additional context in comments.

1 Comment

It is needed to wait untill the table has fully loaded because the elements of the datatable are only available for your JS-selectors as soon as the elements are done loading asynchronously.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.