excel exporter issue
excel exporter issue

Link to test case: test case behind login;
Debugger code (debug.datatables.net):
in datatables.min.js, there is this line
var o = t.header[e].length;
Error messages shown:
.length is undefined method,
Description of problem:
when table views are dynamically changed, and a column with date strings is displayed as first column, header[0] is undefined, resulting in .length not returning a value. I could take screen shots if that helps.
Answers
How are the changes being made? Assuming you mean the table data is changed then it sounds like you might not be using Datatables API's to make these changes. See this FAQ for more details.
Screenshots are typically difficult to debug. If the above doesn't help then please build a simple running test case that replicates the issues so we can see how you are making the changes and to help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Hey Kevin;
Thanks for getting back to me.
The "change" that is being made is column "0" being made visible or not, depending on another UI value (summary vs per day):
Specifically, when the column IS visible (i.e. UI is set to "per day"), via
statTable.column([0]).visible(true);
then header[0] is undefined.
When the column ISN'T visible (ie UI set to "summary")
statTable.column([0]).visible(false);
header[0] IS defined...
Seems to be counterintuitive, but nonetheless, that's what's happening. Does that shed any useful light?
I'm not sure why changing the column visibility to visible would then make a header cell undefined. We'd need a test case showing the issue as Kevin suggested.
Allan
I saw your post earlier and had planned to make a simple to case, before Allan answered, to show this works but was away from my computer until now. As Allan said using column visibility doesn't cause the issue. See this test case:
https://live.datatables.net/wonasuxe/1/edit
There is somethign specific to your environment that is causing the issue. Please update my test case to show the issue ou are having or provide a link to a test case so we can help troubleshoot.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Kevin;
You might be correct about it being environment-specific; I tested the code on my dev box with same DT codebase as the "problem" server, and the export worked just fine.
That said, not really sure what specific issue could be since as noted, the JS code pulled from problem server has latest datatables code, and the same browser is being used to test code from local box and remote server, so JS engine the same as well.
I can try and create a link to live case that highlights issue from server, but a bit involved to and replicate all components.
For debugging purposes you could try using datatables.js instead of the minimized version to get more info in the traceback. Possibly place a browser's breakpoint on that statement. Maybe that will help to debug the issue.
Possibly there is an issue with how you are doing this. Can you update my test case to show how this is done? Maybe you can replicate the issue.
Kevin