Datatables translation and pagination

0

This page has datatables

Followthecode:

vartable=$('#js-table-lista-chamados').DataTable({"sDom": '<"search-box"r>ltip',
    "lengthChange": false,
    "language": {
        "sEmptyTable": "Nenhum registro encontrado",
        "sInfo": "Mostrando de _START_ até _END_ de _TOTAL_ registros",
        "sInfoEmpty": "Mostrando 0 até 0 de 0 registros",
        "sInfoFiltered": "(Filtrados de _MAX_ registros)",
        "sInfoPostFix": "",
        "sInfoThousands": ".",
        "sLengthMenu": "_MENU_ resultados por página",
        "sLoadingRecords": "Carregando...",
        "sProcessing": "Processando...",
        "sZeroRecords": "Nenhum registro encontrado",
        "sSearch": "Pesquisar",
        "oPaginate": {
            "sNext": "Próximo",
            "sPrevious": "Anterior",
            "sFirst": "Primeiro",
            "sLast": "Último"
        },
        "oAria": {
            "sSortAscending": ": Ordenar colunas de forma ascendente",
            "sSortDescending": ": Ordenar colunas de forma descendente"
        }
    }
});

$('#fini').change(function() {
    table.draw();
});
$('#ffin').change(function() {
    table.draw();
});

$("#searchbox").on("keyup search input paste cut", function() {
    table.search(this.value).draw();
});

$('#numeroSolicitacao').on('keyup', function() {
    table
    .column(0)
    .search(this.value)
    .draw();
});

$('#descricaoIncidente').on('keyup', function() {
    table
    .column(3)
    .search(this.value)
    .draw();
});


$('#status').on('keyup', function() {
    table
    .column(4)
    .search(this.value)
    .draw();
});


$('#analista').on('keyup', function() {
    table
    .column(7)
    .search(this.value)
    .draw();
});

I want to do the same thing on another page so I changed the name of the js and the fields however it does not work could someone help me understand why?

var table = $('#js-table-lista-vendas-clientes-mes').DataTable({
        "sDom": '<"search-box"r>ltip',
        "lengthChange": false,
        "language": {
            "sEmptyTable": "Nenhum registro encontrado",
            "sInfo": "Mostrando de _START_ até _END_ de _TOTAL_ registros",
            "sInfoEmpty": "Mostrando 0 até 0 de 0 registros",
            "sInfoFiltered": "(Filtrados de _MAX_ registros)",
            "sInfoPostFix": "",
            "sInfoThousands": ".",
            "sLengthMenu": "_MENU_ resultados por página",
            "sLoadingRecords": "Carregando...",
            "sProcessing": "Processando...",
            "sZeroRecords": "Nenhum registro encontrado",
            "sSearch": "Pesquisar",
            "oPaginate": {
                "sNext": "Próximo",
                "sPrevious": "Anterior",
                "sFirst": "Primeiro",
                "sLast": "Último"
            },
            "oAria": {
                "sSortAscending": ": Ordenar colunas de forma ascendente",
                "sSortDescending": ": Ordenar colunas de forma descendente"
            }
        }
    });

    $("#searchbox").on("keyup search input paste cut", function() {
        table.search(this.value).draw();
    });

    $('#CodMaster').on('keyup', function() {
        table
        .column(2)
        .search(this.value)
        .draw();
    });

    $('#RazaoSocial').on('keyup', function() {
        table
        .column(3)
        .search(this.value)
        .draw();
    });


    $('#NomeFantasia').on('keyup', function() {
        table
        .column(4)
        .search(this.value)
        .draw();
    });


    $('#Tipo').on('keyup', function() {
        table
        .column(5)
        .search(this.value)
        .draw();
    });

Why does it work in one and the other not? in the case the structure? including js-table-lists-sales-clients-mes it works with simple examples

$(document).ready(function() {
$('#example').DataTable();

});

If I put a translation or pageLength to 10, to run 10 a page does not work unfortunately.

    
asked by anonymous 18.10.2018 / 16:07

0 answers