Lock DataTables table while doing ajax.url().load

Lock DataTables table while doing ajax.url().load

iweedoniweedon Posts: 3Questions: 1Answers: 0
edited June 2020 in Free community support

I have a DataTables table with cells bind to the function. On the checkbox trigger I need to reload a table but I would like to stop users from clicking on the cells while reloading table. I have got an error message: $.fn.DataTables.tables().column is not a function

    var oTable = $("#table").DataTable({
                "bProcessing": true,
                "bPaginate": false,
                "bAutoWidth": false,
                "sDom": '<"tableTopS"<"tableTopSearchtrn"f>>t',
                "oLanguage": {
                    "sEmptyTable": "AAAAA", "sSearch": "<i></i>", 
                },
               "sAjaxSource": Iurl(),
       "sAjaxDataProp": "trainers",
       "aoColumns": aoColumns,
                "fixedHeader": true,
                "aoColumnDefs": [
                    { "aDataSort": [1, 0, 3], "aTargets": [0] },
                    { "aDataSort": [1, 0], "aTargets": [1] },
                    { "aDataSort": [2, 3, 1, 0], "aTargets": [2] },
                    { "aDataSort": [3, 1, 0], "aTargets": [3] }
                ],
         "fnRowCallback": function (nRow, aData, iDisplayIndex) {

                    $(nRow).data("user_id", aData["Id"]);
                    for (var ii = 0; ii < subjects.length; ii++)
                    {
                                            var cell = $('td:eq(' + (3 + ii) + ')', nRow);
                        cell.bind('click', function () { apt(this); });
                                         }

                   return nRow;
              }
        });
            $('#checkbox').click(function () {
                $.fn.DataTable.tables().columns().unbind();

                oTable.ajax.url(new_url).load(function () {
                 $.fn.DataTable.tables().columns().bind();
                 });
                });

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.