CKEDITOR story

05-22-2015 19:05

Checkout the example in playground

Popular WYSIWYG CKEDITOR works well with jsreport and it can be very nicely used together with wrapped-html recipe and self printing exporting reports.

Story...

Imagine you often need to create a pdf document like an invoice. This document includes some of your inputs but also inputs from a customer. So you need to ask the customer for these information every time. Then you may need to send the filled document back to the customer but he requires changes so he sends it back to you to update the document and this goes on and on.

Lets AUTOMATE it!

  1. Create a document using javascript templating engines based on input data, this is a get started article
  2. Make the document self exportable into pdf using wrapped-html recipe
  3. Use scripts extension to automatically send the mail with the report
  4. The final trick... Add CKEDITOR and let the end user to update the content before exporting to the pdf

Integrating CKEDITOR is actually pretty easy:

  1. just reference it from the CDN in your template.
  2. add contenteditable="true" attribute to the element you want to have editable
  3. that is it, note that you can use javascript to validate user inserted correct values or other required stuff

Checkout the example in playground

ckeditor