fooplugins / FooTable

jQuery plugin to make HTML tables responsive
https://fooplugins.com/plugins/footable-jquery/
Other
2.12k stars 636 forks source link

Footable v3 - Button only fired first Page #879

Open thiagoferreirape opened 4 years ago

thiagoferreirape commented 4 years ago

Hi guys , look .

i 'm using Footable with Laravel 7 , where i have a template file .

footable.css inside tag Head

<link href=" {{ asset('css/plugins/footable/footable.bootstrap.css') }} " rel="stylesheet">

footable.min.js on end body

<script src="{{ asset('js/plugins/footable/footable.min.js') }} "></script> .

on my body i have a foreach where a i create my table

<thead>
                    <tr>

                        <th data-hide="phone">Cod</th>

                        <th class="text-right" data-sort-ignore="true">Operation</th>
                    </tr>
                </thead>
<tbody>
    @foreach ( $some condition )
                               <tr>

                                <td>
                                  {{$some->id}}
                                 </td>
 <td class='text-right'>
                                    <div class='btn-group operations'>
                                    <button class='btn-white btn btn-xs' data-action='4'><i class='fas fa-undo-alt' aria-hidden='true'></i></button>

                                    </div>
                                </td>
</tr>
@endforeach

</tbody>
 <tfoot>
                    <tr>
                        <td colspan="6">
                            <ul class="pagination float-right"></ul>
                        </td>
                    </tr>
                </tfoot>

on my Jquery inside document.ready :

$('.footable').footable(); 

$('.operations').on('click','button',function() {

console.log('fired');

    });

but only fired when i am first page or only first 10 results rows.

for example , if a i have 11 rows , pagination with 10 rows per page.

so i 'll have 2 pages , page 1 with 10 rows and page 2 with 1 row , if a click on 11 row the event dont fired .

someone know what could cause this issue ?