EasyUI Forum
September 22, 2020, 10:30:59 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: CK Editor Integration  (Read 14888 times)
manojvijayan
Newbie
*
Posts: 13


View Profile Email
« on: December 19, 2012, 01:32:00 AM »

Hi,
How to integrate CK Editor in a form using easyUI.


Logged
stworthy
Administrator
Hero Member
*****
Posts: 3575


View Profile Email
« Reply #1 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);
Logged
devnull
Sr. Member
****
Posts: 425


View Profile
« Reply #2 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 ?
« Last Edit: December 09, 2014, 01:57:32 AM by devnull » Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3575


View Profile Email
« Reply #3 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/
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!