Checkbox y búsqueda persistente JQuery y DataTable

Checkbox persistentes en JQuery:

    $(document).ready(function () {

        var checkboxValues = JSON.parse(localStorage.getItem('checkboxValues')) || {},
            $checkboxes = $("#contenedor").find(':checkbox');

        $checkboxes.on("change", function(){
          $checkboxes.each(function(){
            checkboxValues[this.id] = this.checked;
          });
          
          localStorage.setItem("checkboxValues", JSON.stringify(checkboxValues));
        });

        // On page load
        $.each(checkboxValues, function(key, value) {
          $("#" + key).prop('checked', value);
        });

    });

 

DataTable búsqueda persistente:

    var oTable = $('#tabletd').DataTable({
        "stateSave": true,
    });

 

Borrar filtros Checkbox y DataTable:

    $( "#boton_borrar_filtros" ).on( "click", function() {
        oTable.state.clear();
        localStorage.removeItem('checkboxValues');
        window.location.reload();
    });