我想將取出的數據庫值傳遞給模態popup.I已從數據庫中提取值並將其列爲帶有分頁的表。將數據庫值傳遞給模態彈出
'name'字段有鏈接,並會在觸發鏈接時顯示模型彈出窗口。我想列出從laravel 5.3鏈接中檢查的名稱的詳細信息。
現在模型彈出與'Modal Header 3'爲所有link.I想知道如何傳遞值模態彈出並顯示特定id的細節。我想知道我是否需要單獨的頁面或控制器來執行此操作。在哪裏寫模式彈出式查詢。如何顯示特定Id的詳細信息。
ID名稱年齡
1 XX 26
2 YY 28
3 ZZ 30
<table border = 1>
<tr>
<td>ID</td>
<td>Passanger Name</td>
<td>Destination</td>
<td>Created Date</td>
</tr>
@foreach ($users as $user)
<tr>
<td>{{ $user->p_id }}</td>
<td><a href="#" class="viewPopLink" role="button" data-id="{{ $user->p_id }}" data-toggle="modal" data-target="#myModal">{{ $user->p_name }}<a></td>
<td>{{ $user->destination }}</td>
<td>{{ $user->created_date }}</td>
</tr>
@endforeach
</table>
{{$users->links()}}
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Modal Header {{ $user->p_id }}</h4>
</div>
<div class="modal-body">
<p>Some text in the modal.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
使用jQuery設定值 – Komal