Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Bind issue with ckeditor

New Here ,
Dec 01, 2010 Dec 01, 2010

I have a drop down that calls a function to return a list of ID's. Based on the ID that is selected it calls another function to return something (within a <cftextarea> tag.  This works fine unless I am using ckeditor on my page which turns the textarea into an iframe which I think is whats causing the data to not populate in that textarea.  I have run the ajax debugger and there are no issues, everything is being passed as it should be. and I has run this in multiple browsers so that is not the issue.
Has anyone run into this?  I googled and cannot find anything.

Running ColdFusion 9.0.1
Thanks

1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 16, 2014 Mar 16, 2014

I have the same exact problem. Did you ever find a fix?

This is what I get from ckeditor support, but I haven't been able to resolve the problem yet.

Hi,


CKEditor in fact replaced this textarea.

It set display:none for it and creates new elements.

It then uses this textarea to populate it with data and submit it to server when you want to submit page.


Now if editor gets created and populated with data before bind finishes its job then it won't work.


You need to either download data to textarea and then load CKEditor or you need to load editor, set some (loading screen), download data to some other element like div (with allignment  letf:-5000px;) and once this data finishes loading (you need to know that somehow) you can use CKEditor setData method to load it into editor.


Regards,

Jakub Świderski

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 16, 2014 Mar 16, 2014
LATEST

I have resolved this using jQuery. Instead of using a bind, when the select changes I get the data via ajax and then populate the editor using the setData method from ckeditor.

$(document).ready(function()

          {

                    $(".template").change(function()

                    {

  if($(this).val() != '')

                              {

                              var mySelect=$(this).val();

                              $.ajax({

                                        url: "myService.cfc",

                                        type: "post",

                                        dataType: "json",

                                        data: {method: "myMethod", mySelect: (mySelect) },

                                        success: function (data){

                                                  CKEDITOR.instances['myEditor'].setData(data);

                                                  },

                                error: function (xhr, textStatus, errorThrown){

                                          console.log(errorThrown);

                                                  }

                                          }); 

                              }

  });

});

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources