Click here to Skip to main content
15,888,968 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
JavaScript
I am working on an mvc application.. i have to make ckeditor uneditable after setting data to it..please guide how to do this  
.. i tried setReadOnly() but i am getting 'function is is not recogized' message 
success: function (data) {
                                if (data.success) {
                                    //alert(data.EmpContent);
                                    debugger;
                       
                                    CKEDITOR.instances['textarea1'].setData(data.EmpContent));
Posted
Comments
Amit Jadli 2-Dec-15 7:19am    
You could destroy ckeditor before the ajax and reinitialize with read only constrain like this..
config.readOnly = true;

or after setting the data you could disable the textarea..
$('#textarea1').prop("disabled", true);

1 solution

After setting data to "textarea1" you need to make "textarea1" input control uneditable. For that you can add disabled attribute with disabled value to input control at run time. Code sample as shown below.
$("#textarea1").attr("disabled", "disabled");
 
Share this answer
 
Comments
Snesh Prajapati 3-Dec-15 0:31am    
As Amit has suggested in comment that code also will work.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900