Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

CKeditor into Smartclient

$
0
0
Hello,
I want to integrate Ckeditor in Smartclient.
My code is
Code:

ClassFactory.defineClass("CKEditor", "Canvas").addProperties({
    redrawOnResize: false,

    getInnerHTML : function () {
        // Write out a <textarea> with a known ID.
        return "<textarea id='" + this.getID() + "_ckEditor' style='width:" + this.getWidth() + "px;height:" + this.getHeight() + "px;margin-bottom:10px'></textarea>";
    },

    draw : function () {
        if (!this.readyToDraw()) return this;

        // Call the superclass method to draw, then have CKEditor replace the <textarea> we
        // wrote out with a CKEditor widget.
        this.Super("draw", arguments);
        this._ckEditor = CKEDITOR.replace(this.getID() + "_ckEditor", {
            // Use a base zIndex of 300,000 for the dialogs such as the Insert Special Character dialog.
            baseFloatZIndex: 300000,

            // Disable these plugins because they cause the CKEditor widget to grow outside of the
            // canvas' bounds.
            removePlugins: "autogrow,resize,maximize,div,elementspath"
        });
        return this;
    },
    getValue:function() {
        return CKEDITOR.instances[this.getID()+"_ckEditor"].getData();
    },
    setValue:function(value) {
        if (CKEDITOR.instances[this.getID()+"_ckEditor"]) {
            CKEDITOR.instances[this.getID()+"_ckEditor"].setData(value);
        } else {
            ckInitValue = value;
        }
    }
});

This is the code I use to display
Code:


VLayout.create({
        ID: "VLayoutNotasExt",
    members:[       
            CKEditor.create({
                ID:"editorNotasExt",
                height: "100%",
                                autoDraw:false,
                ID: "editorNotasExt",
                height:"100%",
                margin: 3,
                overflow:"hidden",
                //canDragResize:true,
                showEdges:true
          })
      ]
        })

https://isomorphic.atlassian.net/wiki/display/Main/Using+CKEditor+or+fckEditor+as+a+widget


I have a button "Show Editor", the first time that you click on the button gives the following error and does not show the editor.

Code:

TypeError: a.ui.space(...) is null.
The second time, shows the editor and the error
Can someone help me?
Thank you!

Viewing all articles
Browse latest Browse all 4756

Trending Articles