Opened 8 years ago

Closed 6 years ago

Last modified 6 years ago

#8261 closed New Feature (wontfix)

jQuery adapter: allow to work with existing instances

Reported by: Alfonso Martínez de Lizarrondo Owned by: Piotr Jasiun
Priority: Normal Milestone:
Component: General Version:
Keywords: HasPatch Cc:

Description

It's common to see a problem for people trying to use things like jQuery validation on existing CKEditor instances and they just see that the value that they get is the original value.

The jQuery adapter only adds its code when a CKEditor instance is created with it, but it's common for the people to use things like replace by class or a server side integration, and then they want to use AJAX or validation using jQuery and they say that they have added the jQuery adapter but that it still doesn't work.

The idea to fix it is simple: the adapter should always use a listener CKEDITOR.on( 'instanceCreated' ) so that every instance gets augmented to be used properly with jQuery. That way is they add the adapter they'll always now that .val() with an element that is replaced with CKEditor will work.

Change History (10)

comment:1 Changed 8 years ago by Jakub Ś

Keywords: HasPatch? added
Status: newconfirmed

comment:2 Changed 8 years ago by Frederico Caldeira Knabben

Good idea.

comment:3 Changed 7 years ago by Jakub Ś

Keywords: HasPatch added; HasPatch? removed

comment:4 Changed 6 years ago by Piotr Jasiun

Owner: set to Piotr Jasiun
Status: confirmedreview

comment:5 Changed 6 years ago by Piotr Jasiun

Milestone: CKEditor 4.2

comment:6 Changed 6 years ago by Piotr Jasiun

in branch/ticket #10281

comment:7 Changed 6 years ago by Piotr Jasiun

Status: reviewassigned

comment:8 Changed 6 years ago by Piotr Jasiun

I think that adapter shouldn't have an impact on editor created without it. It could be a reason of many problems if behavior of exiting code would change by just including adapter.

If you want to use jQuery validation with editors created without adapter everything you should do is to refresh textarea using editor.updateElement(); before validation.

Moreover you can connect save button of your editor to jQuery submit method using:

editor.on( 'save', function() {
	$( element.form ).submit();
	return false; //return false to cancel default behavior
} );
Last edited 6 years ago by Piotr Jasiun (previous) (diff)

comment:9 Changed 6 years ago by Piotr Jasiun

Resolution: wontfix
Status: assignedclosed

comment:10 Changed 6 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 4.2
Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy