-
Bug
-
Resolution: Fixed
-
Normal
-
8.0.5, 9.5.1.1
-
Security Level: Jimmy
Steps to Reproduce
Run fiddle
https://zkfiddle.org/sample/1r0q5hl/2-ckeditor-in-detail
Open detail
Current Result
Editor cannot be used, text zone fails to initialize.
Clicking editor controls will throw:
Uncaught TypeError: Cannot read property 'getSelection' of undefined at CKEDITOR.dom.selection.getNative (ckez.wpd:475) at new CKEDITOR.dom.selection (ckez.wpd:473) at a.CKEDITOR.editor.getSelection (ckez.wpd:471) at new CKEDITOR.plugins.undo.Image (ckez.wpd:1264) at CKEDITOR.plugins.undo.UndoManager.save (ckez.wpd:1258) at a.b (ckez.wpd:1253) at a.l (ckez.wpd:13) at a.<anonymous> (ckez.wpd:15) at a.CKEDITOR.editor.CKEDITOR.editor.fire (ckez.wpd:16) at a.execCommand (ckez.wpd:295) getNative @ ckez.wpd:475 CKEDITOR.dom.selection @ ckez.wpd:473 CKEDITOR.editor.getSelection @ ckez.wpd:471 CKEDITOR.plugins.undo.Image @ ckez.wpd:1264 save @ ckez.wpd:1258 b @ ckez.wpd:1253 l @ ckez.wpd:13 (anonymous) @ ckez.wpd:15 CKEDITOR.editor.CKEDITOR.editor.fire @ ckez.wpd:16 execCommand @ ckez.wpd:295 CKEDITOR.tools.extend.click @ ckez.wpd:703 execute @ ckez.wpd:704 (anonymous) @ ckez.wpd:705 (anonymous) @ ckez.wpd:36 callFunction @ ckez.wpd:36 onclick @ ckeditor95-2.zul:1
Expected Result
Editor initialized properly when added to the page / when detail is opened
Debug Information
The node of detail will be moved if open/close.
CKeditor uses an iframe as an editable area.
If an iframe was moved, the content will be unloaded: https://stackoverflow.com/q/28613526
Workaround
Call restore on the detail content to force the editor to check its initialization status.
<script><![CDATA[ zk.afterLoad("zkex.grid", function () { var _xDetail = {}; zk.override(zkex.grid.Detail.prototype, _xDetail, { open: function() { var result = _xDetail.open.apply(this, arguments); zWatch.fireDown('onRestore', this); return result; } }); }); ]]></script>
- relates to
-
ZK-4360 Missing onRestore for CKEditor on tabbox accordion specifically
- Closed