The real update processing code is as follows:
Copy the codeThe code is as follows:
= function () {
= (); // Take out the content edited by FCKEditor, here is our focus
("OnAfterLinkedFieldUpdate");
};
OK, we have basically understood the general process. As for how FCKEditor performs binding update processing before executing onsubmit, we will not be able to do so.
However, here we need to understand several object classes of FCKEditor, one is FCKConfig (saves some related configuration information) and FCK (takes the content edited in the editor). These classes are all in the IFrame page where the editor is located and cannot be accessed on the page where the LinkedField is located.
Below is our usage code, here is how to create an FCKEditor instance through js.
First define a global FCKEditor object:
Copy the codeThe code is as follows:
var oFCKEditor = null;
var oFCKEditor = null;
After page initialization (usually completed in the onload event of the body) create an oFCKEditor object
Copy the codeThe code is as follows:
oFCKeditor = new FCKeditor( 'frmEntity_editor_content'/*LinkedField element id*/, '100%;','400px', 'Default');
= "${()}/editor/" ;
() ;
oFCKeditor = new FCKeditor( 'frmEntity_editor_content'/*LinkedField element id*/, '100%;','400px', 'Default');
= "${()}/editor/" ;
() ;
Next is the processing before executing the ajax request submission:
Copy the codeThe code is as follows:
var inputElementId = "frmEntity_editor_content"; // LinkedField element id
var frameElement = eval(inputElementId + "___Frame"); // The id of the IFrame used to embed FCKEditor
var inputElement = eval(inputElementId);
= (); // Get the content in FCKEditor and synchronize it into LinkedField
// Collect submissions and execute ajax request
....
var inputElementId = "frmEntity_editor_content"; // LinkedField element id
var frameElement = eval(inputElementId + "___Frame"); // The id of the IFrame used to embed FCKEditor
var inputElement = eval(inputElementId);
= (); // Get the content in FCKEditor and synchronize it into LinkedField
// Collect submissions and execute ajax request
....
This is my integration process. It is actually quite simple. However, I encountered a problem. After opening the page, the input focus always stays in the editing area of FCKEditor. This situation will not occur in the examples provided by FCKEditor itself, and there is no difference in writing. I don’t know where the problem lies. If you have any questions, please let me know.