dataTables_info count only gets accurate after changing window size

dataTables_info count only gets accurate after changing window size

smohantysmohanty Posts: 14Questions: 3Answers: 0

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

Hi!

I have a question about the dataTables_info div. This is the one on the bottom-left part of the table that shows "Showing X to Y of N entries".

I'm noticing by default that the "Y" value is double of the rows in the viewport of what my table is. So in other words, say my table loads with 10 rows by default...it'll say "showing 1 to 20 rows...". Then - upon scrolling down it'll keep this 20 row range.

I noticed upon resizing the window (even just minimizing and re-maximizing) ..that the correct value of "showing 1 to 10 rows.." is displayed.

I'm using scrolly:730px and I have all my rows' no-wrap enabled so that they are the same height. Anybody know what's going on?

Thanks!

Answers

  • allanallan Posts: 61,438Questions: 1Answers: 10,049 Site admin

    Can you link to a test case showing the issue please? Sounds like the table might get getting initialised hidden?

    Allan

  • smohantysmohanty Posts: 14Questions: 3Answers: 0
    edited May 2021

    I'm using a Meteor Wrapper of DataTables and so I don't know how to create a test case.

    The params I'm using are

    new Tabular.Table({
        name: 'Collection',
        collection: Collection,
    
        colReorder: true,
    
        scroller: true,
        deferRender: true,
        scrollCollapse: true,
        scroller: {
            loadingIndicator: true
        },
    
        buttonContainer: '.col-sm-6:eq(0)',
        buttons: [
            {
                extend: 'colvis',
                text: 'Show/Hide',
                postfixButtons: [
                    {
                        extend:'colvisGroup',
                        text:'Show all',
                        show:':hidden'
                    },
                    {
                        extend:'colvisRestore',
                        text:'Revert to saved columns'
                    }
                ],
                collectionLayout: 'fixed four-column'
            }
        ],
    
        scrollY: "730px",
        scrollCollapse: true,
        scrollX: true,
        
        pub: "tabular_Coll",
    
        stateSave: true,
    
        columns: [
               LOTS OF COLUMNS (some with their own render fns)
        ],
    
        extraFields: [EXTRA_FIELDS],
    
        changeSelector: (selector, userId) => {
            return selector;
        },
    
        rowCallback: (row, data) => {
          row.title = data.foo+ "\n" + data.bar;
        }
    }
    

    Using just the scroll options in a test case did not reproduce the issue though.

    Do you see anything glaring here with my other extensions?

    Also, what do you mean by "Sounds like the table might get getting initialised hidden?"

    Thanks!

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

  • smohantysmohanty Posts: 14Questions: 3Answers: 0

    So...the data comes from a Pub/Sub mechanism which is apart of Meteor. That's what pub is, it's basically the data or ajax src

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    It's not a known issue, so to progress this we'll need to see it to be able to debug it,

    Colin

This discussion has been closed.