tableTools printing off the page

tableTools printing off the page

fthomasfthomas Posts: 8Questions: 0Answers: 0
edited January 2010 in Plug-ins
I just want to first off thank you for a great plugin! Actually, I'm surprised that I may have either found a bug in my configuration or in the software.

This concerns the tableTools plugin. If you select the print window, and then print the window, it will cut off the bottom of the table at the bottom of the page. I just tried printing a document with about 140 records and it printed exactly one page and cut off at record 71.

Any ideas?

Thanks again!

Frank Thomas

Replies

  • fthomasfthomas Posts: 8Questions: 0Answers: 0
    The mystery deepens. I am using IE8 and when I go to a print preview, I see four pages to be printed and it does print the four pages, but when I just select the print button in IE, it only prints one page.

    Spookey. Sounds like some MS foolishness!
  • allanallan Posts: 55,045Questions: 1Answers: 8,638 Site admin
    Hi Frank,

    I'm afraid I don't have an IE8 machine to hand at the moment, but it appears to work okay for me in Safari and Firefox (Mac). So I'd agree - it looks like a rather odd bug from Microsoft... (wearing my shiny suit today - bugs just slip right off... :-) ).

    The way TableTools does it's print feature is to set all the display elements to display:none, other than the table's child elements and all of it's parent elements. This gives just the table itself in the page, with everything else hidden - so I don't really see any reason for it not working, other than a browser print bug.

    Doing a quick google search appears to confirm that you are not the only one suffering from printing issues in IE8. Sorry I can't help more, other than to suggest filing a bug with the IE team.

    Regards,
    Allan
  • fthomasfthomas Posts: 8Questions: 0Answers: 0
    Was afraid of that. But thanks for the very quick reply!!

    Hey, I do have another question or two for you Allan. Is there any way to input a range of values into the filter engine, like jan-oct? Or have a filter engine that is an OR engine and not an AND engine? Not a biggie, but just curious.

    Second, is there any way to show a button that can quickly remove any settings like sort or filter when there is one placed from a cookie?

    Frank
  • fthomasfthomas Posts: 8Questions: 0Answers: 0
    Also, another question that you may have already come by.

    I have a couple of pages that load a couple thousand records. Do you know how I could hide the standard table with your 'processing' indicator until the data is completely pulled and then formatted by dataTables?

    Frank
  • allanallan Posts: 55,045Questions: 1Answers: 8,638 Site admin
    Hi Frank,

    1. Range filters: Yes it is possible, but you'll need to do a little bit of work (although not days and days of it!) to integrate a range filter for date ranges using strings. Have a look at this example for a numeric range filter: http://datatables.net/examples/api/range_filtering.html . The documentation for filtering development can be found here: http://datatables.net/development/filtering

    2. To remove settings using a button, you can assign an event handler to the button which will modify the table's settings. For example $('button:eq(0)').click( function () { oTable.fnSettings().oPreviousSearch.sSearch=""; } ); will clear a previous search (need to redraw the table as well of course). The settings object isn't documented on this site, rather you'd need to dive into the code and see what the various parameters you want to clear are. Shout here if you want a hand with these.

    3. You could use CSS to do it. If the processing information is made to be the first element in the DataTables DOM range (well - I suppose it doesn't matter where it is, first just seems like a good idea...), and set that to be position:absolute, and the containing object position:relative, then you can set the height and width to 100% and it will take up the whole table. A little touch of opacity and it should look good.

    It's useful to use Firebug when playing with the processing element to get what you want, since you can disable the 'display:none' and modify the other properties quite easily.

    Regards,
    Allan
This discussion has been closed.