Opened 10 years ago

Closed 10 years ago

#13622 closed Bug (invalid)

IE9 - CKEdtor is being disabled after save when using knockout js

Reported by: Liran Fridman Owned by:
Priority: Normal Milestone:
Component: General Version: 4.4.7
Keywords: Cc:

Description

I don't actualy know how to elaborate on this bug, but here is how it goes: I'm using CKEditor for multiple textareas on the same screen using knockout js "foreach". The CKEditor is implemented along with knockout js like this:

ko.bindingHandlers.CKEDITOR = {

init: function (element, valueAccessor, allBindings, viewModel, bindingContext) {

var ckEditorValue = valueAccessor(); var id = $(element).attr('id'); var allBindings = allBindings(); var options = allBindings.EditorOptions; var visible = (typeof allBindings.visible == 'undefined' ? true : allBindings.visible); id = (typeof allBindings.id == 'undefined' ? id : allBindings.id);

if (!visible
id == ) {

$(element).hide(); return;

}

$(element).attr('id', id).addClass("orb-ckeditor");

var ignoreChanges = false;

var defaultConfig = {}; defaultConfig.toolbar = [

["Undo", "Redo"],

["Bold", "Italic", "Underline", "Strike", "RemoveFormat", "-", "TextColor"], ["NumberedList", "BulletedList", "Outdent", "Indent"], ["JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock"], ["Link", "Unlink"] ];

defaultConfig.defaultLanguage = 'en'; defaultConfig.removePlugins = 'resize, wordcount, elementspath, magicline'; defaultConfig.enterMode = CKEDITOR.ENTER_BR;

defaultConfig.on = {

change: function () {

ignoreChanges = true; ckEditorValue(instance.getData()); ignoreChanges = false;

}

}; $.extend(defaultConfig, options); var instance = CKEDITOR.replace(id, defaultConfig);

instance.setData(ckEditorValue());

ckEditorValue.subscribe(function (newValue) {

if (!ignoreChanges) {

instance.setData(newValue);

}

});

}

};

And here is the HTML:

<div class="quiz-settings" data-bind="foreach: items">

<textarea data-bind="CKEDITOR: PropertyObjectValue, visible: (PropertyType == 'MULTILINES'
PropertyType == 'EMAIL'), id: 'txtProp' + PropertyID"></textarea>

</div>

I'm saving the data using AJAX call and on the success method I'm re-binding the data to the editors. It works fine in Chrome but in IE9 the editor is disabled after the save action when I click inside the editor to edit but when I click on the editors menu buttons such as the Bold or Underline it becomes active again

I have no idea why this happens or how to fix it...

Change History (2)

comment:1 Changed 10 years ago by Liran Fridman

Sometimes even the Bold button doesn't release it and opening the color plette does... Right clicking in the editor text area gives this error message: "Error: Unable to get value of the property 'check ReadOnly': object is null or undefined"

Last edited 10 years ago by Liran Fridman (previous) (diff)

comment:2 Changed 10 years ago by Jakub Ś

Resolution: invalid
Status: newclosed

his is not the right place to ask questions. This is bug tracker.

For community support try posting a question on http://stackoverflow.com/tags/ckeditor

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy