TableTools and .Net MVC(?)

TableTools and .Net MVC(?)

rfritschrfritsch Posts: 2Questions: 0Answers: 0
edited November 2011 in General
I'm using dataTables with a .net project (C# .net 4.0). DataTables itself went in without a problem, everything pretty much just worked :) When I added tableTools (I WANT the save functions!!) nothing showed up. I downloaded the base demo, put it on a separate directory, it worked fine. i can see with Fiddler I'm not getting any errors loading files, tableTools.js is loading without issue. I suspect the images and flash files may not be in the right place, but I've reproduced those problems on the demo site (where I have you base setup working) and I see expected errors in Fiddler that do not show up on the .net project. I've had mixed success tracing the javascript, but it sure looks like tableTools is never used (I added an alert box at the top:
TableTools = function( oDT, oOpts )
{
alert("Start of tableTools");
I see this when I run the demo, don;t when I run .net

My document ready code is almost exactly standard:

$(document).ready( function () {
$('#example').dataTable( {
"sDom": 'T<"clear">lfrtip'
} );
alert("Hello World!");
} );

I added the alert just to confirm I'm executing THIS code, and the table is enrollees not example.

Again, this does show up as expected when I do the same thing on the demo version. Using Firebug I see a DIV tag class DTTT_container that does not show up on the .net version, I'm pretty sure this is wrong, but no idea why (as in what do I need to do to get it to show up). I get the same result with Chrome, Firefox and IE9, everything works on your demo (on my machine), dataTables itself works (great) in the .net project, so I'm pretty sure I've got my names etc correct but there is no sign of tableTools. About the only thing unusual is that the html table is generated by JS and I was worried about timing, but I don't THINK that's it, as the base dataTools works fine, I can sort columns, page etc. I've been through the forums, I don't see quite the same thing. Hopefully I'm just missing something stupid. Any suggestions would be very much appreciated.

Thanks,

Bob Fritsch

Replies

  • jcrawfordjcrawford Posts: 172Questions: 0Answers: 0
    edited November 2011
    i believe this is an issue with the swf file not being loaded, try specifically telling it where the swf is located. Something like this

    [code]
    "sDom": 'T<"clear">lfrtip'
    "oTableTools": {
    "sSwfPath": "/path/to/TableTools.swf",
    },
    [/code]
  • rfritschrfritsch Posts: 2Questions: 0Answers: 0
    Nope, that's not it (if the path is NG, the buttons show up, but clicking them does nothing). However, after a little rearranging, rebooting a couple of times, I can't make it fail any more. Still not sure what was wrong, but nice pretty files are being saved. Looking forward to exploring some of the other options!
This discussion has been closed.