How to copy paste data from excel to datatables

How to copy paste data from excel to datatables

phamvananphamvanan Posts: 2Questions: 0Answers: 0
edited April 2013 in General
Hi All,
Can you help paste data on datatable?

oTable = $("#tbl_summary").dataTable({
"aaData": data,
"bFilter": false,
"sScrollY": "300px",
"sScrollX": "100%",
"sScrollXInner": size,
"bScrollCollapse": true,
"bPaginate": false,
});
DataTable will auto to draw the table depend on data before, but now, i want customize it, ex: I want add a column on table.
I don't do it.
Thanks for any help.

An.

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    You cannot 'paste to a DataTables'. You might be able to use some magic Flash component to handle a paste event, but not in Javascript.

    Allan
  • phamvananphamvanan Posts: 2Questions: 0Answers: 0
    Hi Allan,
    Thanks for your response,
    I will reference your suggest.

    An.
  • kongondokongondo Posts: 2Questions: 0Answers: 0
    Allan,

    Thanks for your great plugin!

    On the question of Excel-like copy pasting, have a look at the following SlickGrid plugin. Would it be possible to do something similar with DataTables based on their code? Thanks.

    http://labs.nereo.com/slick.html (demo and explanation)
    https://github.com/Celebio/SlickGrid/blob/master/plugins/slick.cellexternalcopymanager.js.suggestion
    https://github.com/Celebio/SlickGrid/blob/master/plugins/slick.cellexternalcopymanager.js
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Yes I'm sure it would be thinking about it. You could listen for the paste event in modern browsers and then add the data to the table through the API.

    Allan
  • kongondokongondo Posts: 2Questions: 0Answers: 0
    edited June 2013
    Cool! I wouldn't have a clue where to get started :). Any pointers how to port the code appreciated...or if someone wants to take this up please? Thanks.
This discussion has been closed.