CKEDITOR_Adapters.jQuery
The jQuery Adapter allows for easy use of basic CKEditor functions and access to the internal API. To find more information about the jQuery Adapter, go to the jQuery Adapter section of the Developer's Guide or see the "Create Editors with jQuery" sample.
Filtering
Properties
-
editor : editor
CKEDITOR_Adapters.jQuery#editor
Existing CKEditor instance. Allows to easily use the internal API.
Note: This is not a jQuery object.
var editor = $( 'textarea' ).ckeditor().editor;
-
promise : Function
CKEDITOR_Adapters.jQuery#promise
The jQuery Promise object that handles the asynchronous constructor. This promise will be resolved after all of the constructors.
Methods
-
A jQuery function which triggers the creation of CKEditor with
<textarea>
and editable elements. Every<textarea>
element will be converted to a classic (iframe
-based) editor, while any other supported element will be converted to an inline editor. This method binds the callback to theinstanceReady
event of all instances. If the editor has already been created, the callback is fired straightaway. You can also create multiple editors at once by using$( '.className' ).ckeditor();
.Note: jQuery chaining and mixed parameter order is allowed.
Parameters
callback : Function
Function to be run on the editor instance. Callback takes the source element as a parameter.
$( 'textarea' ).ckeditor( function( textarea ) { // Callback function code. } );
config : Object
Configuration options for new instance(s) if not already created.
$( 'textarea' ).ckeditor( { uiColor: '#9AB8F3' } );
Returns
Object
jQuery.fn
-
Returns an existing CKEditor instance for the first matched element. Allows to easily use the internal API. Does not return a jQuery object.
Raises an exception if the editor does not exist or is not ready yet.
Returns
Object
-
val() → Object
CKEDITOR_Adapters.jQuery#val
Overwritten jQuery
val()
method for<textarea>
elements that have bound CKEditor instances. This method gets or sets editor content by using the editor.getData() or editor.setData() methods. To handle the editor.setData() callback (assetData
is asynchronous),val( 'some data' )
will return a jQuery Promise object.Returns
Object
String|Number|Array|jQuery.fn|function(jQuery Promise)
Events
-
dataReady( evt )
CKEDITOR_Adapters.jQuery#dataReady
-
destroy( evt )
CKEDITOR_Adapters.jQuery#destroy
-
getData( evt )
CKEDITOR_Adapters.jQuery#getData
-
instanceReady( evt )
CKEDITOR_Adapters.jQuery#instanceReady
-
setData( evt )
CKEDITOR_Adapters.jQuery#setData