#3368: Strange behavior when placed inside dynamically-created elements
----------------------+-----------------------------------------------------
 Reporter:  pferreir  |       Owner:                
     Type:  Bug       |      Status:  new           
 Priority:  Normal    |   Milestone:  CKEditor 3.0  
Component:  General   |     Version:  SVN (CKEditor)
 Keywords:            |  
----------------------+-----------------------------------------------------
 The following code:

 {{{
 #!js

      var div = document.createElement('div');
      var div2 = document.createElement('div');

      var editor = CKEDITOR.appendTo( div );
       document.getElementById('tests').appendChild(div);

       var button = document.createElement('button');
       button.innerHTML = 'click me';
       button.onclick = function(){
              editor.destroy();
              editor = CKEDITOR.appendTo( div2 );
              document.getElementById('tests').appendChild(div2);
       };

       document.getElementById('buttons').appendChild(button);
 }}}

 Fails with:

 {{{
 holderElement is null
 }}}

 as soon as one clicks the button. I noticed this since I'm using CKeditor
 to implement some kind of "click & edit" rich text field, and I'm creating
 the containing div dynamically, each time the user clicks the field.

 I could solve this by re-using the same div each time the field switches
 to edit mode, but that would be hacky, and I don't think CKeditor should
 fail here (correct me if I'm wrong, please).

 Regards,

 Pedro

-- 
Ticket URL: <http://dev.fckeditor.net/ticket/3368>
FCKeditor <http://www.fckeditor.net/>
The text editor for Internet
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
FCKeditor-Trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fckeditor-trac

Reply via email to