datatables jquery click event not working after pagination

后端 未结 6 1085
轮回少年
轮回少年 2020-12-17 08:50

I am using http://datatables.net/


I trigger ajax call

6条回答
  •  情话喂你
    2020-12-17 09:09

    I had the same issue. Every time my AJAX function(modalContentAjaxRefresh) update the table the paging stop. SO I just had to change my code from :

    From :

    $('.modal-toggle').off('click', modalContentAjaxRefresh).on('click', modalContentAjaxRefresh);

    to:

    $('#DataTables_Table_0_wrapper').on("click", ".modal-toggle", modalContentAjaxRefresh);

    My button inside datatable is :

    < a title="Edit" class="btn btn-xs btn-info modal-toggle"
    data-style="zoom-in" href="/setting/account/{{account_turn.uuid}}/update" data-toggle="modal" data-target="#editAccount" wecare-method="GET">

提交回复
热议问题