handle modals for each row in table with jquery laravel

11 Views Asked by At

my main objectif is display data in a form of table i have used bootstrap table and the rendering is good but also for each row i added a button that open a modal to linked up more data :

<tbody>
                        @isset($accords)
                            @foreach($accords as $accord)
                                <tr data-item-id="{{$accord->codePostBesoin}}" data-item-name="Item{{$accord->id}}">
                                    <td>{{$accord->responsable}}</td>
                                    <td>{{$accord->nomResponsable}}</td>
                                    <td>{{$accord->codeStructure}}</td>
                                    <td>{{$accord->exercice}}</td>
                                    <td>
                                        <button class="btn btn-primary" data-toggle="modal" data-target="#nominatifModal{{$loop->index}}" id="btn{{$loop->index}}">nominer</button>

                                        @include('depEmploitGestionDesCarrier.recrutement.nominatifModal',['accordId'=>$accord->id,'dre'=>$accord->responsable,'structure'=>$accord->codeStructure,'postBesoin'=>$accord->codePostBesoin])
                                    </td>
                                </tr>
                            @endforeach
                        @endisset
                        </tbody>

when i use j query for modal i got the uncaught error &

opening the modal and passing some data works fine , but the jquery part , if somme body got any ideas ?

0

There are 0 best solutions below