Issue with multiple tables on the same page

Issue with multiple tables on the same page

GstgGstg Posts: 66Questions: 4Answers: 0
edited February 2022 in DataTables

I have 8 tables running on the same page with tabs. I have 2 tables that are basically identical, table3 and table8. Either works independently as long as I remove the table code from one of them. But when the code is present for both of them, neither of them works. I've narrowed it down to this section of code below. It exists in both tables. But if I remove this section from the 2nd table, than the first table works, and the second table doesn't show. I'm trying to figure out what in this code would prevent the other tables from running.

The Grid & List displays are alternatives to the normal table view. We turn off the table view and turn on either the Grid View or List View depending on the custom display buttons they select. (List / Table / Grid)

Thanks

        // Restore the grid / table display state
        initDisplay(table8, true, false, false);

        // And every draw thereafter
        table8.on('draw column-visibility', function () {
            displayGrid(table8, '#sort_grid8');
                    displayList(table8, '#sort_list8');
        });

        $('#sort_table8')
//          .css('display', 'none')
            .after($('#sort_grid8'))
            .after($('#sort_list8'));

        // Insert SearchBuilder before the search box
        new $.fn.dataTable.Buttons(table8, {
            buttons: [{
                extend: 'searchBuilder',
                text: '⚙',
                config: {
                    i18n: {
                        button: {
                            0: '⚙',
                            _: '⚙ (%d)'
                        }
                    }
                }
            }]
        });

        table8.buttons( 1, null ).container().prependTo(
            $('.dataTables_filter', table8.table().container())
        );

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

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    There's nothing obvious there. We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • GstgGstg Posts: 66Questions: 4Answers: 0

    I've tried to create a test case. Unfortunately most of the tables are ajax based, so I've tried to reduce all the code to the bare minimum, but I have not been very successful as of yet. But I wanted to post the full code. We are also using local files from the DataTables download, so I had to try to replicate the ones I think were being used with the https versions.

    This is the same code that I'm having multiple issues with, so I wanted to try and get a test case working to explain all the issues. It defiantly would be easier to see it on the website (where the tabs and tables are all working) but unfortunately we are not public yet. Allan has access to the website or I could setup an account for any other admin, if that would be easier. It's showing I still have $750 in credits, but I can also buy more credits if its needed.

    1 - This issue (table3 works, but table 8 is not) as described above
    2 - I can't get the OTHER tables (not 3 or 8) to show any filter / DOM that are set
    3 - https://datatables.net/forums/discussion/71632/redraw-after-view-change#latest

    Thanks so much for any assistance

    Test case (not working yet)

    http://live.datatables.net/topafube/1/edit

  • GstgGstg Posts: 66Questions: 4Answers: 0

    Do you have any suggestions for developers that we might hire to help us with the last few outstanding issues we have on our Data tables deployment. We have 4 issues that seem minor, but we have been unable to figure them out.

    We don't mind paying to have someone look at it, but I would think they need to be fairly familiar with the data tables environment.

    Thanks

  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin

    Hi,

    Apologies - I'll get back to you by e-mail shortly!

    Allan

Sign In or Register to comment.