Copying to clipboard

Copying to clipboard

ragerrager Posts: 2Questions: 0Answers: 0
edited March 2009 in General
I've read over the API and features, and do not see an easy way to copy the contents of the table onto the clipboard. My goal is to get the table into excel, and the table being built is usually a few thousand lines long, which makes manually highlighting a major pain. I've seen the "copy to clipboard" feature on a few sites, so I was hoping dataTables would have this feature also (I'm through the API call fnGetNodes?). I'm assuming it can, it's just a bit over my head!

Any help would be greatly appreciated!

Replies

  • allanallan Posts: 63,578Questions: 1Answers: 10,483 Site admin
    There are two ways to go here

    1. Go through the absolute nightmare of trying to use copy and paste in the browser (Ben and Dion over at Mozilla labs have been doing this recently: http://almaer.com/blog/supporting-the-system-clipboard-in-your-web-applications-what-a-pain

    2. Integrate with Flash. It requires the Flash plug-in of course, but it should be straight forward. This is something I've been meaning to add for DataTables for a while - I'll try to get around to it soon :-)

    Regards,
    Allan
  • ragerrager Posts: 2Questions: 0Answers: 0
    Yeah, I've had some problems using other sites copy to clipboard features in the past. Wasnt sure what the current state of it was.

    I ended up finding a nice solution that allows you feed any table to a tiny php page that saves the table as an excel file. It loses the formatting, but it works good enough!
This discussion has been closed.