Question for initComplete

Question for initComplete

AlexolAlexol Posts: 11Questions: 4Answers: 0
edited November 2018 in Free community support

Hello,
Excuse my english, but I didn't quite understand how "initComplete" works

Related this post : https://datatables.net/forums/discussion/43209

I've a problem with language.url (french) and this : https://datatables.net/examples/api/multi_filter

So Allan said "initComplete" but I don't understand... This is my code :smile:

<script type="text/javascript">
    $(document).ready(function() {
        // Setup - add a text input to each footer cell
        $('#table_datatable tfoot th').each( function () {
            var title = $(this).text();
            $(this).html( '<input type="text" placeholder="Chercher '+title+'" />' );
        } );

        // DataTable
        var table = $('#table_datatable').DataTable({
            initComplete: function(settings, json){
                language: {url: "//cdn.datatables.net/plug-ins/1.10.16/i18n/French.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();
                }
            } );
        } );
    } );
    </script>

Search is OK but still english... Thank you

Answers

This discussion has been closed.