Why is the data(like page info) not coming in the datatable?

Why is the data(like page info) not coming in the datatable?

sniperrsniperr Posts: 1Questions: 1Answers: 0
edited January 2023 in Free community support

(https://datatables.net/forums/uploads/editor/ul/4vgg0i1ykxdd.png "")

 var table2 = $('.metionsTable').DataTable( {
                    "ordering": false,
                        "language": {
                            "lengthMenu": "Mentions per page _MENU_ ",
                           // "lengthMenu": [ 50 ,100 ,250 ],
                        "search": "Search in mentions:",
                            "searchPlaceholder": "Search...",
                                    "paginate": {
                                "first":    '«',
                                "previous": '‹',
                                "next":     '›',
                                "last":     '»'
                            },
                            "aria": {
                                "paginate": {
                                    "first":    'First',
                                    "previous": 'Previous',
                                    "next":     'Next',
                                    "last":     'Last'
                                }
                            }

                        },
                        "pagingType": "full_numbers",
                        "lengthMenu": [50 , 100 , 200 ]
                        // "buttons": ['copy', 'excel', 'pdf']
                    });


$('.metionsTable').on( 'page.dt', function (event) {
                        let fil = filters
                        console.log(table2.page.info() , table2,)
                table2.on('page.dt', function(event) {
                            $('html, body').animate({
                                scrollTop: $("#datatable-buttons_wrapper").offset().top
                            }, 'slow');
                            $('thead tr th:first-child').focus().blur();
                        });
       table2.buttons().container().appendTo('#datatable-buttons_wrapper .col-md-6:eq(0)');
 var table2 = $('#datatable').DataTable({
        lengthChange: false,
        buttons: ['copy', 'excel', 'pdf', 'colvis']
    });

    table2.buttons().container()
        .appendTo('#datatable-buttons_wrapper .col-md-6:eq(0)');

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

  • allanallan Posts: 63,528Questions: 1Answers: 10,473 Site admin

    You redeclare table2 - do you mean to do that?

    However, side from that, I think we'd need a link to a page showing the issue to be able to debug it properly.

    Allan

Sign In or Register to comment.