AJAX Datatable - Handle Return

Asked

Viewed 24 times

-2

Hello,

[I edited my question]

How to handle server variables returned via Datatable and Ajax?

In the stretch "defaultContent" i need to pass the values of the variables: id_usuario and id_toast that are coming from the server.

table = $('.dataTable').DataTable({
            'destroy':true,
            'ajax':{
                'url':DIRPAGE + '/painel/exibir-brinde/todos',
                'method':'GET',
                'dataSrc':''
            },
            
            'columns':[
                {'data':'nome'},
                {'data':'doc'},
                {'data':'brinde'},
                {'data':'data'},
                {'data':'empresa'},
                {'defaultContent':'<td class="id"><button class="btn btn-success btn-resgatar" value="id_usuario" id_brinde="id_brinde"><i class="fas fa-plus-circle"></i> Resgatar </button></td>'}
            ]
        });
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.