Buttons icon indicating copy to clipboard operation
Buttons copied to clipboard

Ignore download option

Open ValeriiTsarov opened this issue 8 years ago • 3 comments

In my current case, I need to disable "download" option. I need only PDF document JSON and don't need to open PDF or download it. Your current options work in mode "download"/"open" only. After my change everyone may use this construction:

{
  extend: 'pdfHtml5',
  footer: true,
  ignoreDownload: true,
  download: 'open',
  customize: function (doc) {
    //My processing doc JSON
  }
}

ValeriiTsarov avatar Nov 01 '17 12:11 ValeriiTsarov

Thanks for this. I think this would maybe be a good option to add into the existing download option - perhaps download: 'ignore' for example.

Out of interest, what is the use case? What would you do with just the document object?

DataTables avatar Nov 01 '17 13:11 DataTables

Modify the code as you wish :)

About the case: I have made PDF button (pdfHtml5) for a user on frontend (thanks a lot to your project). I have made CSS copier from table to doc JSON also. Now, I have the PDF which looks very close to a colored datatable. Next case: generate the same PDF (colors, fonts etc) on backend. I have made a custom button which based on pdfHtml5 and I send generated/processed/colored doc JSON to my backend from customize: function (doc) {. This is the point where I had a problem: I can use only 'open' or 'download' mode for option 'download'.

I hope, it was clear. :)

ValeriiTsarov avatar Nov 01 '17 14:11 ValeriiTsarov

Sounds good - thanks. I think this is probably an edge use case to be honest, but lets leave this open to see if there is any other interest in it.

DataTables avatar Nov 01 '17 16:11 DataTables

Closing stale issues - no further requests for this, so closing for now.

AllanJard avatar Oct 17 '23 14:10 AllanJard