Datatables for going to bit crazy

0

I want to join the two codes but it does not work, can you help me?

 $(document).ready(function() {
        $('#tabla').DataTable( {
            "language": {
                "lengthMenu":"Mostrar _MENU_ registros por página.",
                "search" : "Buscar",
                 "zeroRecords": "Lo sentimos. No se encontraron registros.",
                "info": "Mostrando página _PAGE_ de _PAGES_",
                "infoEmpty": "No hay registros aún.",
                "infoFiltered": "(filtrados de un total de _MAX_ registros)",
                "LoadingRecords": "Cargando ...",
                "Processing": "Procesando...",
                 "SearchPlaceholder": "Comience a teclear...",
                 "paginate": {
         "previous": "Anterior",
         "next": "Siguiente", 
          }
            },
         
      
       "sort": false
      
        } );
    } );

 $(function () {
        if ($('.dataTable').length > 0) {
            $('.dataTable').dataTable({
                "bPaginate": true,
                    "bLengthChange": false,
                    "bFilter": true,
                    "bSort": true,
                    "bInfo": true,
                    "bAutoWidth": false,
                    'aoColumnDefs': [{
                    'bSortable': false,
                        'aTargets': ['nosorting']
                }],
                
     
            });


 $(document).on('keyup', "input[type='number']", function(){
        var oTable = $('.dataTable').dataTable();
        oTable.fnFilter($(this).val());
    });
            $('.dataTables_filter').empty(); // clears the content generated    
            $('.dataTables_filter').append("<div class='input-group' style='width: 250px'>" +
                "    <input type='number' class='form-control' placeholder='Search..'/>" +
                "    <span class='input-group-addon'>" +
                "        <i class='fa fa-search' style='width: 15px; padding-left: 5px'></i>" +
                "    </span>" +
                "</div>")
        }
    });
    
asked by Francisco José Gimeno Esteban 03.12.2018 в 16:28
source

0 answers