Updated Datatables - ScrollX not working sporadically, possibly data specific?
Updated Datatables - ScrollX not working sporadically, possibly data specific?
We recently updated our Datatables versions in the following manner:
Datatables 1.10.16 > 1.11.3
Buttons 1.3.1 > 2.0.1
FixedHeader 3.1.2 > 3.2.0
Added FixedColumns 4.0.0
We also swapped from using a function in the drawCallback to process various elements such as turning T/F into the appropriate icon to using a function within the createdRow option.
After all our changes everything was working fine within our dev environment so we went live with the change, and it seems to work correctly for most clients, but there is one in particular where things are very broken. Either the horizontal scroll bar just doesn't appear at all, or the column widths are completely different between the table body, header and footer. I have used the debugger and uploaded the following: https://debug.datatables.net/uvopel
In that example, I loaded the debugger after the first draw when the scroll bar had not appeared. I then changed the ordering to descending, which brings back the scroll bar but results in all the widths being different.
Sometimes calling table.columns.adjust() will fix the column widths but remove the scrollbar, sometimes it will bring back the scroller, but it also sometimes won't fix either issue.
One other thing I noticed was in the "Check for common issues" in the debugger it says that tables which have scrolling enabled should have their width set to be 100%, but we are using style="width:100%" on the table.
Thanks!
Answers
Hi,
Thanks for the details. Are you able to give me a link to your page showing the issue? Also have you managed to narrow the issue down to a specific browser, or is it happening for all?
Allan
Hi Allan,
I've just PM'd you with details to login to our website. We've just tried in IE and Firefox where everything seems to work... So seems to be an issue with Chrome and Chromium based Edge, which is what we use.
Thanks
Hi,
Could you try using this version of the DataTables script please? I've just committed this change which the nightly now carries.
It seems that Chrome's sub-pixel rendering is what was tripping us up here - the measured width of the table shifts by 0.01 pixels while rendering the scrolling, tripping our "emergency" code, resulting in what you are seeing!
Allan
Hi,
Thanks so much, that's fixed it! Do you know roughly when that will make it into a main release as we plan to switch to combined css and js files in the near future.
Can you see anything else wrong with our configuration? The other strange behaviour we've noticed is when we enable fixed columns via the control we added, the fixed table scrolls about a pixel left when scrolling the table, causing the left border to disappear which looks slightly strange.
Thanks again!
That and a tweak in our Bulma integration are the only two changes since 1.11.3, so likely it will be the end of the month or early November before it drops as 1.11.4.
We've noticed that as well and think it has something to do with the borders, but haven't yet got a fix I'm afraid.
Allan