No data available in the table
No data available in the table
hey alan,
happy new year! when using the fixedheader extension i'm finding some strange behavior.
when you scroll down far enough for the fixedheader to kick in and then refresh the page it shows the table of info and an empty table ('no data available') above it after scrolling back up to the top.
similarly, when doing different editing functions on the table they would get hung up with this error:
TypeError: Cannot read property 'style' of undefined
presumably about that empty table.
it seems as if when the fixedheader kicks in a new table is created in order to keep the header info up with the one being scrolled. so when DT api calls are made our code gets confused as to which is being referenced.
does this sound about right? what do you think the best way around it is? something more foundational than simply interjecting a find-the-right-datatable function before each api call?
thanks!
This question has an accepted answers - jump to answer
Answers
for some visual reference: http://imgur.com/tZi5BHS
Are you able to link to a test page showing the issue please. Also, have you tried the nightly version?
Thanks,
Allan
I don't currently, but I can get one up today most likely. I'm a bit hesitant to not use the production-ready builds since it'll be in production for us w enterprise accounts and at the focal point of our value-add—literally can't operate w/o it functioning correctly.
Until I can get a test version up for you, here's a link to the debug info: http://debug.datatables.net/ehanuw
Thanks - the test page would be great. PM me if you don't want to make the page public, by clicking my name above and then the "Send message" button.
Allan
awesome, will do. likely this afternoon so you can have it in the a.m.
thanks!
best,
Its being caused by this line:
That is selecting all
table
elements on the page and making them a DataTable. If it is already a DataTable, then it just gets the existing table, but if it isn't it is creating the table.When the FixedHeader it active, there are multiple tables - hence the issue.
Might be best to use the
window.dt
variable that you assign rather than creating a new instance.Allan
Thanks, Allan!