EasyUI Forum

General Category => General Discussion => Topic started by: manojvijayan on December 19, 2012, 01:32:00 AM



Title: CK Editor Integration
Post by: manojvijayan on December 19, 2012, 01:32:00 AM
Hi,
How to integrate CK Editor in a form using easyUI.




Title: Re: CK Editor Integration
Post by: stworthy on December 19, 2012, 05:43:44 AM
Here is an example to load data into form that contains ckeditor.

Code:
<form id="f1" novalidate>
<input name="name">
<input name="age">
<textarea id="message" name="message" class="ckeditor"></textarea>
</form>

Now call the code below to load data.

Code:
var data = {
name:'name2',
age:30,
message:'message2'
};
$('#f1').form('load', data);
CKEDITOR.instances.message.setData(data.message);


Title: Re: CK Editor Integration
Post by: devnull on December 09, 2014, 01:08:02 AM
Is it possible for ckeditor to replace a standard textarea and still have easyui write to it during form loan and read from it during form save as it would with any standard textarea ?

http://docs.ckeditor.com/#!/guide/dev_installation

Code:
<textarea id="description" class="ckeditor" name='description' >

<script>
  CKEDITOR.replace('description');
</script>

http://jsfiddle.net/seKvb/22/

The problem seems to be that data loaded via ajax does not get updated to the ckeditor ?


Title: Re: CK Editor Integration
Post by: stworthy on December 09, 2014, 07:49:06 AM
You need to set the ckeditor's value after loaded data successfully. Please refer to the updated example http://jsfiddle.net/seKvb/23/