How to add CKEditor?

How to add CKEditor?

ladokjohanladokjohan Posts: 15Questions: 3Answers: 0

Hi,

I have tried to install the CKEditor plugin but can't get it to work. CKEditor is installed in folder php/lib/ckeditor and the demo file works fine.

I have added <script src="php/lib/ckeditor/ckeditor.js"></script> to the index.php file.

I have added editor.ckeditor.js to js folder.

In table.uppdoksupport.js I changed

fields: [
            {
                "label": "Information",
                "name": "text",
                "type": "textarea"
            }

to

fields: [
            {
                "label": "Information",
                "name": "text",
                "type": "ckeditor"
            }

The only result is that no table data is shown any more in the table... What have I missed or made wrong?

Replies

  • allanallan Posts: 57,263Questions: 1Answers: 9,121 Site admin

    That should be all that is needed. Are you seeing any errors reported in your browser's console?

    Are you able to give me a link to the page so I can check it out please?

    Thanks,
    Allan

  • ladokjohanladokjohan Posts: 15Questions: 3Answers: 0

    Firefox console gives this error:
    uncaught exception: Error adding field - unknown field type ckeditor

    I have made a version without required login at http://goo.gl/ygA9S2 where you can see the empty table.

    Thanks,

    Johan

  • allanallan Posts: 57,263Questions: 1Answers: 9,121 Site admin

    I don't see the Editor CKEditor being included anywhere on that page?

    Allan

  • ladokjohanladokjohan Posts: 15Questions: 3Answers: 0
    edited July 2016

    Now I get these errors:

    ReferenceError: jQuery is not defined
    <anonymous>
     editor.ckeditor.js:40
    <anonymous>
     editor.ckeditor.js:28
     editor.ckeditor.js:40:1
    uncaught exception: Error adding field - unknown field type ckeditor
    

    My header is:

            <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/s/dt/jqc-1.11.3,dt-1.10.10,b-1.1.0,r-2.0.0,se-1.1.0/datatables.min.css">
            <link rel="stylesheet" type="text/css" href="css/generator-base.css">
            <link rel="stylesheet" type="text/css" href="css/editor.dataTables.min.css">
    
            <script src="php/lib/ckeditor/ckeditor.js"></script>
            <script src="js/editor.ckeditor.js"></script>
            <script type="text/javascript" charset="utf-8" src="https://cdn.datatables.net/s/dt/jqc-1.11.3,dt-1.10.10,b-1.1.0,r-2.0.0,se-1.1.0/datatables.min.js"></script>
            <script type="text/javascript" charset="utf-8" src="js/dataTables.editor.min.js"></script>
            <script type="text/javascript" charset="utf-8" src="js/table.uppdoksupport.js"></script>
    

    Have I missed something?

  • allanallan Posts: 57,263Questions: 1Answers: 9,121 Site admin

    Add it after you load DataTables and Editor. It is a plug-in for those libraries, so it needs to be loaded after them.

    Allan

  • ladokjohanladokjohan Posts: 15Questions: 3Answers: 0

    It worked, thanks. :)

This discussion has been closed.