TableTools not working in IE7, no copy or export to excel

TableTools not working in IE7, no copy or export to excel

jkrobbinsjkrobbins Posts: 32Questions: 3Answers: 0
edited September 2011 in TableTools
I've spent hours researching this, and although I've found where others have encountered the same problem, I've yet to find a solution. This problem does not occur in Firefox of course. Think how easy our lives would be if we as web developers didn't have to support IE....anyway.

Using DataTables-1.8.2 I get "Unknown runtime error" on line 135 which is:
[code]this.div.innerHTML = this.getHTML( box.width, box.height );[/code]

Other have suggested changing this line to this:
[code]$(this.div).html(this.getHTML(box.width, box.height));[/code]

..and that gets rid of the error but now the Copy button copies 0 rows to the clipboard, and the Excel button does nothing.

I'm not a Javascript guru and I've run out of ideas on how to fix this. Has anyone found a solution to this?

Replies

  • jkrobbinsjkrobbins Posts: 32Questions: 3Answers: 0
    One more thing...changing the code as shown above creates another error when closing the page. Runtime error, line 52, Object required.
    [code]
    function __flash__removeCallback(instance, name) {
    instance[name] = null;
    }
    [/code]
    Maybe this provides a clue?
  • jkrobbinsjkrobbins Posts: 32Questions: 3Answers: 0
    I've checked for trailing commas and console.out statements in my js. Still getting the same error. I know there is a solution out there somewhere.

    Anybody?
  • wfpetriewfpetrie Posts: 2Questions: 0Answers: 0
    I have the same problem. I don't have any answers though. Just some observations/questions.
    The Copy & Excel buttons on my intranet webpage work fine in FF but not in IE.
    Copy and Excel buttons on internet pages work in both FF and IE.
    Is this a clue to the solution? Maybe a security setting in IE?
  • jkrobbinsjkrobbins Posts: 32Questions: 3Answers: 0
    I wish I could test it on the internet, but this is an intranet app and our IE security policies are set by AD group policies so I can't muck with them. Apparently nobody has a solution to this problem so I guess I'll have to scrap TableTools and find another solution. I've wasted almost two days on this problem and I'm no closer to finding an answer.
  • jkrobbinsjkrobbins Posts: 32Questions: 3Answers: 0
    Finally solved this one. It was an unclosed p element, even though the code validated as Strict according to the w3c validator. After a day and a half of head scratching I realized that it had to be a dom structure problem because the javascript error was traced to a failure to insert the floating div over the tabletools buttons.

    So if for those of you who will eventually run into this error, check your DOM structure. I created a copy of the failing page and then started stripping out sections of it until the error disappeared. Validate your page and fix any errors reported, but even if there are no errors, don't count on it being correct enough for ZeroClipboard to work.
  • wfpetriewfpetrie Posts: 2Questions: 0Answers: 0
    JK,
    Thanks very much. That lead me to my answer. I was nowhere close to figuring this out myself.

    My problem was that my tables were nested in paragraphs. My pages are dynamically generated with Python & a module called HTMLtags. So the tags are automatically opened and closed properly.

    This problem happens even with a validated DOM structure.

    I had nested each table in a paragraph before to get acceptable spacing and alignment when I was doing HTML-only tables. Adding TT to my tables to get those buttons worked with FF but not IE. So, based on your post, I removed the paragraph nesting and presto. It now works on IE too.

    Now all of those managers & bean-counters in the company can figure out how to get the Excel versions of my tables by themselves.
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    @wfpetrie: heh!

    Thanks for posting your solution jkrobbins, it'd have taken me quite a while to find that as well! Generally speaking I've assuming for DataTables and all its plug-ins that the page will be valid HTML, and if it isn't then the browser will figure it out - this one sounds like a little bit of a nightmare one, though.

    Regards,
    Allan
  • FilippKFilippK Posts: 2Questions: 0Answers: 0
    edited March 2012
    Hey,

    Please check my Comment with IE Crash details at:
    http://datatables.net/forums/discussion/comment/32047#Comment_32047
  • deepudeepu Posts: 3Questions: 0Answers: 0
    TableTools not working in , mozilla, IE ; i had tried the above discussed code , it seems doesn't work
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Can you try TableTools 2.1.2.dev (nightly) from the downloads page please: http://datatables.net/forums/discussion/10406/buttons-work-in-ie-and-chrome-but-shock-horror-not-firefox#Item_11 .

    Also - you've posted the same thing three times - please only post a message once!

    Thanks,
    Allan
This discussion has been closed.