Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Javascript based editor won't work in extension object

I am developing an extension object for text input. We allow HTML text so I was looking at using one of the open source solutions like www.ckeditor.com.

I put the ckeditor folder in my extension object folder, and putting a simple test html page (ckeditor.htm) works fine. But if I try to output the exact same HTML into my extension object then just a regular old textarea appears in my extension object and not the rich test editor I expect.

The first error I ran into (or debugged rather) was the fact that apparently extension objects don't have access to anything below the root folder (that seems insane to me). The workaround I found is to add a Definition.xml to the subdirectory and that magically gives it access. I can confirm the .js file loads because if I add an alert in there then I see that alert pop up when my extension object pops up.

Any ideas why this isn't working?

2 Replies
Alexander_Thor
Employee
Employee

Hey,

In your script.js file you are injecting a html page into a page which won't work.
A page can only have a set of html, head and body tags.

And you are correct, to safeguard extensions a definition.xml file has to be present in every, or the last folder in a tree, folder for QVS to serve it up for you. Also this will probably break the css files so you might have to replace the paths to any images.

You also missed to instantiate the editor through CKEDITOR.replace( 'editor1' );

Check out their getting started guide CKEditor 4 Documentation

Not applicable
Author

Ok, I was on vacation last week so just getting around to replying.

Ok, so now all I am doing is outputting the form and contents with a javascript call immediately after to instantiate and it still doesn't work.

What am I missing? Is there a simple way to debug extension objects? So far my development has consisted of just a lot of trial and error.

This should be pretty simple to test out. Does it work for you?