mercredi 2 décembre 2015

Can modals be inside foreach?

this table is a list of recommended students, and when "View details" is clicked, The "Recommendation Details(in text format)" should show in a form of modal... I have no problem at the first row of Recommendation detail, my problem is the following Recommendation details shows only the FIRST Recommendation details..

<table class="table no-margin">
   @foreach($faculty->recommendations as $student)
     <tr>
       <td class="text-muted" valign="middle"><a href="{{ URL::to('/', $faculty->user->id) }}"> Name </a></td>

     <td align="right"><button type="button" class="btn btn-primary btn-view" data-toggle="modal" data-target="#dialog-box" >View Details</button>
          <div class="modal fade" id="dialog-box" role="dialog" aria-hidden="true">
            <div class="modal-dialog" role="document">
              <div class="modal-content">
                <div class="modal-header">
                  <h2>Recommendation Details</h2>
                </div>
                <div class="modal-body">
                  <div class="form-group">           
                    <p class="jobpost-p">{{ $faculty->pivot->recommendation_details }}</p>
                  </div>
                </div>
             </div>
           </div>
        </div> <!--Modal close-->
   @endforeach
</table>



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire