All Questions & AnswersCategory: Front-end QuestionHow can we make CK Editor read only in Angular?
Jack asked 3 years ago

How can we make CK Editor read only in Angular.

Frellebra replied 2 months ago

Given the established association between weight change and blood pressure status, the question arises as to how this interaction functions physiologically clomid pct dosage

Frellebra replied 2 months ago

Epub 2018 Apr 30 buy propecia 5mg usa Johns Hopkins University interview with Martin Markary, MD MPH, Researchers detail how middlemen suppliers can increase hospital bills and drug prices, Medical Press, 18 October 2018

Frellebra replied 2 months ago

lasix Italy Pulmonary arterial hypertension pathophysiology and anesthetic approach

Frellebra replied 2 months ago

lasix not urinating Doses based on body surface area are generally more accurate, and preferably should take into account both body weight and height

1 Answers
jsmount Staff answered 3 years ago

declare var CKEDITOR; 
 
 /**
     * Mark CK Editor field as read only mode
     * @param mode = true or false
     */
    markCKEditorReadOnly(mode = true) {
        setTimeout(() => {
            if (CKEDITOR) {
                let instances = (<any>CKEDITOR).instances;
                let keys = Object.keys(instances);
                keys.forEach((element, index) => {
                    if (instances[element]) {
                        instances[element].setReadOnly(mode);
                    }
                });
            }
        }, 700);
    }

    
    // call function
    this.markCKEditorReadOnly();

Your Answer