Page tree
Skip to end of metadata
Go to start of metadata

RELEASE 2.3.0 OR ABOVE

This event occurs before a document is opened (imported).

Adding Event: Using API

var editorId = 'synapEditor';
var editorConfig = {};
var html = '';
var editor = new SynapEditor(editorId, editorConfig, html);

editor.setEventListener('beforeOpenDocument', function (e) {
});

Adding Event: Function

var editorId = 'synapEditor';
var editorConfig = {};
var html = '';

function SynapEditorBeforeOpenDocument(e) {
}

new SynapEditor(editorId, editorConfig, html);

Adding Event: When the Editor is initialized

var editorId = 'synapEditor';
var editorConfig = {};
var html = '';
var eventListeners = {
    beforeOpenDocument: function (e) {
    }
};

new SynapEditor(editorId, editorConfig, html, eventListeners);

Object Delivered through Functions

In the form of parameter e delivered through functions

e
// release 2.3.0
{
	editor: SynapEditor,
	eventType:  'beforeOpenDocument',
	cancelable: true,
	returnValue: null,
	fileType: 'WORD', // File type ('HTML', 'WORD', 'CELL', ...)
	fileName: 'filename.docx' // File name
}

// release 2.14.6 or above
{
	editor: SynapEditor,
	eventType:  'beforeOpenDocument',
	cancelable: true,
	returnValue: null,
	fileType: 'WORD',
	fileName: 'filename.docx',
    fileSize: 100 // [2.14.6] File size (Unit: Byte)
}
  • No labels