#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 13 years ago by
Keywords: | HasPatch? added |
---|---|
Status: | new → confirmed |
comment:2 Changed 13 years ago by
comment:3 Changed 13 years ago by
Keywords: | HasPatch added; HasPatch? removed |
---|
comment:4 Changed 12 years ago by
Owner: | set to Piotr Jasiun |
---|---|
Status: | confirmed → review |
comment:5 Changed 12 years ago by
Milestone: | → CKEditor 4.2 |
---|
comment:7 Changed 12 years ago by
Status: | review → assigned |
---|
comment:8 Changed 12 years ago by
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 } );
comment:9 Changed 12 years ago by
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
comment:10 Changed 12 years ago by
Milestone: | CKEditor 4.2 |
---|
Good idea.