Ckeditor with jQuery form wizard

跟風遠走 提交于 2019-12-12 01:23:09

问题


I am creating a jQuery wizard based form(form is splitted in 5 steps) wizard form, in last two steps I put two ckeditor respectively.My problem is that these two ckeditors are not responding i.e they dont accept any input.I am unable to figure out why this happens.the same ckeditor works fine without form wizard.I think there is conflict between form wizard plugin and ckeditor plugin but dont know what exactly happens there.

Sample project on github Link of grails project.

Edit1:

This is my custom setting:

<div class="form-content">
    <div class="wizard-ignore">
<script type="text/javascript">
<ckeditor:config var="toolbar_Mytoolbar">
[
    [ 'Bold', 'Italic', 'Underline', 'Scayt' ]
]
</ckeditor:config>

delete CKEDITOR.instances['${name}'];
CKEDITOR.config.scayt_autoStartup = true;
CKEDITOR.config.fillEmptyBlocks = false;
function CKupdate() {
    for (instance in CKEDITOR.instances) {
        CKEDITOR.instances[instance].updateElement();
    }
}
<ckeditor:editor name="${name}" height="100px" width="98%" toolbar="Mytoolbar">
<g:if test="${summary}">
    ${summary}
</g:if>
</ckeditor:editor>

</script>
</div>
</div>

When I put some alert(); statement in above script ckeditor works in firefox.unable to find root cause.Any suggestion/idea will be helpful to me.

Edit2: Sample project on github Link of grails project.


回答1:


Jan Sundman answer is absolutily correct just add class wizard-ignore to the editor.


You are using grails CKEditor plugin, you can set class as

<script type="text/javascript">
$(function () {
    $("#${name}").addClass('wizard-ignore');

    <ckeditor:config var="toolbar_Mytoolbar">
    [
        [ 'Bold', 'Italic', 'Underline', 'Scayt' ]
    ]
    </ckeditor:config>

    delete CKEDITOR.instances['${name}'];
    CKEDITOR.config.scayt_autoStartup = true;
    CKEDITOR.config.fillEmptyBlocks = false;

    function CKupdate() {
        for (instance in CKEDITOR.instances) {
            CKEDITOR.instances[instance].updateElement();
        }
    }
});
</script>
<ckeditor:editor name="${name}" height="100px" width="98%" toolbar="Mytoolbar">
  <g:if test="${summary}">
    ${summary}
  </g:if>
</ckeditor:editor>

and if you use ckeditor directly as described in the link then just add class as

<g:textArea name="foo" class="wysiwyg wizard-ignore">



回答2:


Set the class wizard-ignore to the editor, see if that helps.



来源:https://stackoverflow.com/questions/19679612/ckeditor-with-jquery-form-wizard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!