how to add form in datatables

how to add form in datatables

usmanfarzandusmanfarzand Posts: 1Questions: 1Answers: 0

Working code

{ data: 'id'  ,  "render": function ( data, type, full, meta ) {
                    return 
                    '<a href="/admin/user/'+data+'/'+'edit" class="btn btn-primary" ><span data-feather="edit"></span></a>';
                    
                
                }}

this code is not working

{ data: 'id'  ,  "render": function ( data, type, full, meta ) {
                    return 
                    '<a href="/admin/user/'+data+'/'+'edit" class="btn btn-primary" ><span data-feather="edit"></span></a>';
                    +' '+
                    '<form method="POST" action="{{route('admin.user.destroy', data)}}">
                        @csrf
                        @method('DELETE')

                        <button type="submit" class="btn btn-danger"><span data-feather="delete"></span></button>
                    </form>'
                
                }}

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @usmanfarzand ,

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.