Checkboxes will only work on current pagination page in jQuery datatables

后端 未结 2 1034
半阙折子戏
半阙折子戏 2021-01-16 00:34

I am using jquery data table for listing my content which have checkbox selection and selected content post the data but in submitted form only current page data sent.

2条回答
  •  北海茫月
    2021-01-16 01:12

    you can get all the selected check box values using following code this might be helpful for you

    var myArray = [];
    var id = "";
    var oTable = $("#example").dataTable();
    $(".class1:checked", oTable.fnGetNodes()).each(function() {
        if (id != "") {
            id = id + "," + $(this).val();
        } else {
            id = $(this).val();
        }
    });
    

提交回复
热议问题