_TOTAL not showing correct number
_TOTAL not showing correct number
Hi all,
I have a site behind a firewall, running on an IIS Windows Server. The DataTables work fine, up until results of a table are over 25 records. In my screenshot, I know there are 89 records that should be retrieved. The system we have these records from is very accurate. DataTables, however displays a maximum of 25 total entries for any table that has more than 25 records.
I have tried modifying the jQuery.datatables.js but this value does not change. I am using the quick / simple method of integrating DataTables.
See attached image. Bottom right shows correct records. DataTables has max / total of 25.
Any ideas why? Thanks in advance.
This question has an accepted answers - jump to answer
Answers
Could you give me a link to the page so I can debug it, or use the DataTables debugger so I can take a look at a debug trace?
Thanks,
Allan
Hi Allan,
Thanks for your post. Unfortunately the site is behind a firewall and I cannot allow access to the site itself. I could provide any reports or logs you need though. Is there anything that I could look at specifically? The number 25 seems quite precise, why 25? Strange. Anyway, let me know what I can provide you with.
In the meantime, here is the DataTables debugger report:
https://debug.datatables.net/ofozov
With the navigation from the left hand menu (which is brought in dynamically via our Record Management software), the a href will then load into a DIV on the right, simulating a single page app behaviour using on click on the a href element. The issue I am noticing is on table 2 of the report #nativeTRIMTable.
Hope this helps shed some light.
Thanks again.
Hi,
The debugger trace (thanks for that!) shows that the table at the time it was taken as 23 rows.
How are you populating the table - are you creating the DOM with a server-side script and initialising the DataTable from the DOM (it doesn't appear to be Ajax sourced data from the debug trace)?
It suggests that the table is not getting the full data set. Perhaps a
WHERE
filter is being applied to the database? Or the for loop isn't running as much as expected?If you don't initialise DataTables, how many records are shown?
Allan
Hi Allan,
Thanks for looking into this.
Yes true, there were 23 records found, but that was on the first table with id updatedTRIMTable. This table loads automatically on page load. Then when clicking through the left side navigation, I can load other data which generate their own tables, one at a time, with id of nativeTRIMTable.
The data is loaded via a URL search method sent to the server which interrogates the SQL database via a DLL. which then displays the result set in the DOM via formatted templates, in which case I use tables. If I disable DataTables, I get the expected results in full, however the built in pagination does not allow for a "back" feature as the URL does not change. The URL passed to it simply loads into a separate DIV on the page. This is where DataTables is the perfect fit.
I cannot seem to find if there is a restriction on the DataTables result set, however I was preparing a screen recording for you, one with DataTables enabled, and one without, however also removing our system's built-in pagination. It seems like the table or div size is restricted and only showing a maximum of 25 rows on the native table. I will investigate further and get back to you.
Thanks. Fabio
Gah - sorry. i missed the fact that there were two tables!
Can you show me the JSON that is being loaded? I'm wondering how many rows of data it loads. Based on your following statement:
it sounds like there is some kind of pagination already - and I wonder if that has a page size of 25, which is thus causing the data to be limited to that.
Allan
Hey again Allan,
Not to worry about the other table
I think you are correct in that even after removing DataTables and the built in pagination I t still only loads 25 rows which it wasn't before. I will send you what I can tomorrow when I'm back at work.
thanks again. fabio
Hi Allan,
I found the issue and managed to resolve it. The URL structured queries we use to display data from HP TRIM were being limited to 25 rows per view with the in-built pagination. When I removed this, it still did not change the display of sections, so I forced the queries to return 200 rows, as for the moment, none of the queries will return more than about 175 or so.
Now DataTables returns and filters on the entire dataset.
Thank you so much for your assistance! Much appreciated.
fabio
Excellent - good to hear you've got it working. Thanks for posting back!
Allan