multiple search boxes when pressing back or forward in the browser

multiple search boxes when pressing back or forward in the browser

melvin007melvin007 Posts: 2Questions: 1Answers: 0
edited September 2022 in Free community support

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:

multiple search boxes when pressing back or forward in the browser

When back or forward button is pressed additional search box and pagination shows up
when back or forward button is pressed again additional search box and pagination shows up again and on and on.

I think it is adding a new table on top of the older table ...
Is there way to correct this problem ?

Thank you!

here is the code

'''<script>

          $(document).ready(function () {

              $('table.display').DataTable({


              destroy: true,



              language: {
                    // this is for the table -- changing languages per page

                    lengthMenu: '페이지당 _MENU_ 표시',
                    zeroRecords: '찾을 수 없음 - 죄송합니다',
                    info: '_PAGES_ 페이지 중 _PAGE_ 표시 ',
                    infoEmpty: '기록이 없음',
                    infoFiltered: '(총 _MAX_ 기록에서 검색)',
                    thousands: ',',
                    search: "검색:",

                    "paginate": {
                      "first":      "첫페이지",
                      "last":       "마지막",
                      "next":       "다음",
                      "previous":   "이전",

                  },

                },


              "order": [],
              // changing the values in the dropdown menu
              "lengthMenu": [ [10, 15, 20, 25, 50, 75, 100, -1], [10, 15, 20, 25, 50, 75, 100, "All"] ],

              "pageLength": 15,
              });
              // styling the pagination button size

              $('.dataTables_paginate').addClass('pagination-sm');




          });


        </script>

Answers

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    I think it is adding a new table on top of the older table ...

    I remember seeing other forum posts with a similar description. I don't remember the details but I believe the problem is due to inserting a -div for the -table, not clearing the div and reinserting the same div. So no one table is overlaid over the other. It would take some debugging of your page to find the issue. If you need help with this please post a link to your page or a test case replicating the issue so we can help debug.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • melvin007melvin007 Posts: 2Questions: 1Answers: 0

    thank you for the reply I will try debugging with your suggestions :)

Sign In or Register to comment.