Try to search your question here, if you can't find : Ask Any Question Now ?

Display foreach data in Jquery ui modal dialog

HomeCategory: stackoverflowDisplay foreach data in Jquery ui modal dialog
Avatarrupesh asked 3 months ago

I have a datatable with foreach data from database and want to add button to each row, which would open the Jquery ui modal, where user will be able
to edit the data from row.

How can I display this foreach data in dialog for every row?

My table:

<tbody>
        @if($invoices)
            @foreach($invoices as $invoice)
                <tr>
                    <td>{{$invoice->invoice_number}}</td>
                    <td>{{$invoice->status}}</td>
                    <td>{{$invoice->created_at}}</td>
                    <td>{{$invoice->supplier_name}}</td>
                    <td>{{$invoice->delivery_date}}</td>
                    <td>{{$invoice->comment}}</td>
                    <td><a class="opener"><i class="fa fa-fw fa-edit"></i></a></td>

                </tr>
            @endforeach
        @endif
        </tbody>

HTML modal window, where should this data be:

<div id="dialog" class="dialog">
    <input id="name">
</div>

Jquery ui dialog script:

$( "#dialog" ).dialog({ autoOpen: false });
        $( ".opener" ).click(function() {
    });
1 Answers
Best Answer
Avatarnaveen answered 3 months ago
Your Answer

16 + 16 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com