Editor
Namespace: Wisej.Web.Ext.OnlyOffice
Assembly: Wisej.Web.Ext.OnlyOffice (4.1.0.0)
Hosts the ONLYOFFICE document editor (basic).
- C#
- VB.NET
public class Editor : Widget
Public Class Editor
Inherits Widget
The editor script (api.js) is loaded from the ONLYOFFICE Document Server set in OnlyOfficeURL. This control is a preliminary implementation: the client configuration is currently fixed in the embedded startup.js script (a .docx document loaded from "Documents/Features Table.docx") and the server options are not sent to the client.
Example:
Adding the editor to a page and pointing it to a private Document Server:
var editor = new Wisej.Web.Ext.OnlyOffice.Editor();
editor.Dock = DockStyle.Fill;
editor.OnlyOfficeURL = "https://docs.example.com/web-apps/apps/api/documents/api.js";
this.Controls.Add(editor);
Constructors
Editor()
Initializes a new instance of Editor.
Properties
InitScript
String: Returns the initialization script that creates the ONLYOFFICE DocsAPI.DocEditor on the client.
The script is loaded from the embedded startup.js resource; the setter is ignored.
OnlyOfficeURL
String: Returns or sets the URL of the ONLYOFFICE Document Server api.js script.
The default value is "https://doc.onlyoffice.com/OfficeWeb/apps/api/documents/api.js". Setting it to null or an empty string restores the default. Changing the value calls Update(). The URL is used when the Packages list is first populated, so set it before the control is created on the client.
Example:
Using a self-hosted Document Server:
this.editor1.OnlyOfficeURL = "https://docs.example.com/web-apps/apps/api/documents/api.js";
Packages
List<Package>: Returns the list of packages loaded by the client before the widget is initialized.
The list contains the ONLYOFFICE api.js script located at OnlyOfficeURL. The package is added the first time the property is read, only if the list is empty; changing OnlyOfficeURL after that doesn't change the source of the package already in the list.