dowm41315 2016-10-03 08:16
浏览 171
已采纳

将数据库值传递给模态弹出窗口

I want to pass the fetched database value to modal popup.I have fetched values from database and listed as table with pagination.

'name' field has link and will show model popup while triggering a link.I want to list the details of name which I check from the link in laravel 5.3.

Now model pop up trigered with 'Modal Header 3' for all link.I want to know how to pass the value modal popup and show the details of particular id. I want to know to know shall I need separate page or controller to do this.Where to write the query for modal popup.How can I display the details of specific Id.

id name age

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">&times;</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>
  • 写回答

2条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥20 asn1c编码问题,懂asn1的人很简单
      • ¥60 在排球比赛中,排球落于界限上时,人工判断存在一定的主观因素。利用图像处理的方法来计算排球落点相对界限中心位置,判断结果。
      • ¥15 使用vs2019开发的动态链路库在win7环境下使用有问题
      • ¥30 quartus prime画电路图,要发源文件和电路图每个模块批注,源程序和仿真结果
      • ¥15 MFC滚动条如何正确使用
      • ¥15 缓冲区算法求面积,基于文献
      • ¥50 电路PCB原理图设计AD19
      • ¥15 openstack 云平台搭建 创建实例错误
      • ¥15 联想笔记本网页加载突然出了问题不知道什么原因
      • ¥30 python猜单词小游戏改错 简单!!急!