language file and individual column searching

language file and individual column searching

floseflose Posts: 1Questions: 0Answers: 0
edited September 2015 in Free community support

Hello,

Sorry for my english.

I wish to use "Language file" (in French) and "Individual column searching (text inputs)".

When I instal "searching" alone --> OK

When I instal "language" alone --> OK

But when I instal "language" and after "searching", the texte is in french but the research don't work.

// My code :

$(document).ready(function()
{   $('#example').DataTable( {
                "language": {
            "url": "//cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/French.json"  }
    } );
// Setup - add a text input to each footer cell
    $('#example tfoot th').each( function () {
        var title = $('#example thead th').eq( $(this).index() ).text();
        $(this).html( '<input type="text" placeholder="Search '+title+'" />' );
    } );

    // DataTable
    var table = $('#example').DataTable();

    // Apply the search
    table.columns().every( function () {
        var that = this;
        $( 'input', this.footer() ).on( 'keyup change', function () {
            if ( that.search() !== this.value ) {
                that
                    .search( this.value )
                    .draw();
            }
        } );
    } );
} );

Where is the problem ?
Please, help me

Replies

  • bene40bene40 Posts: 1Questions: 0Answers: 0
    edited September 2015

    I have the same problem with Italian language. Any ideas?!?
    My code:

    $(document).ready(function () {
    
        // Setup - add a text input to each footer cell
        $('#scksp00f_table tfoot th').each(function () {
            var title = $('#scksp00f_table thead th').eq($(this).index()).text();
            $(this).html('<input type="text" placeholder="Cerca ' + title + '" />');
        });
        // DataTable
        var table = $('#scksp00f_table').DataTable({
            "language": {
                "url": "<?php echo base_url('assets/DataTables/Italian.json'); ?>"
            }
        });
    
        // Apply the search
        table.columns().every(function () {
            var that = this;
    
            $('input', this.footer()).on('keyup change', function () {
                if (that.search() !== this.value) {
                    that
                            .search(this.value)
                            .draw();
                }
            });
        });
    });
    
This discussion has been closed.