Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
---
layout: post
title: Disable drag and drop in document editor in React Document editor component | Syncfusion
description: Learn here all about Disable drag and drop in document editor in Syncfusion React Document editor component of Syncfusion Essential JS 2 and more.
title: Disable drag and drop in React DOCX Editor | Syncfusion
description: Learn here all about Disable drag and drop in Document Editor in Syncfusion React Document Editor component of Syncfusion Essential JS 2 and more.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Learn here all about Disable drag and drop in Syncfusion React Document Editor component of Syncfusion Essential JS 2 and more.

platform: document-processing
control: Disable drag and drop in document editor
control: Disable drag and drop in Document Editor
documentation: ug
domainurl: ##DomainURL##
---

# How to disable drag and drop in document editor in React Document editor component
# How to disable drag and drop in the Document Editor in React Document Editor component

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to disable drag and drop in the React Document Editor


[React DOCX Editor](https://www.syncfusion.com/docx-editor-sdk/react-docx-editor) (Document Editor) provides support to drag and drop contents within the component and it can be customized(enable and disable) using [`allowDragAndDrop`](https://ej2.syncfusion.com/react/documentation/api/document-editor-container/documentEditorSettingsModel/#allowdraganddrop) property in Document editor settings.
[React Document Editor](https://www.syncfusion.com/docx-editor-sdk/react-docx-editor) (Document Editor) provides support to drag and drop contents within the component and it can be customized (enable and disable) using the [`allowDragAndDrop`](https://ej2.syncfusion.com/react/documentation/api/document-editor-container/documentEditorSettingsModel/#allowdraganddrop) property in Document Editor settings.

The following example illustrates to customize the drag and drop option.
The following example illustrates how to customize the drag and drop option.

```typescript
var settings = { allowDragAndDrop: false };
var hostUrl = 'https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/';
const settings = { allowDragAndDrop: false };
const hostUrl = 'https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/';

<DocumentEditorContainerComponent id="container" height={'590px'} serviceUrl={hostUrl} documentEditorSettings={settings}/>
```

> The Web API hosted link `https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/` utilized in the Document Editor's serviceUrl property is intended solely for demonstration and evaluation purposes. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the [GitHub Web Service example](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) or [Docker image](https://hub.docker.com/r/syncfusion/word-processor-server) for hosting your own web service and use for the serviceUrl property.
N> The Web API hosted link `https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/` utilized in the Document Editor's serviceUrl property is intended solely for demonstration and evaluation purposes. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the [GitHub Web Service example](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) or [Docker image](https://hub.docker.com/r/syncfusion/word-processor-server) for hosting your own web service and use for the serviceUrl property.

>Note: Default value of [`allowDragAndDrop`](https://ej2.syncfusion.com/react/documentation/api/document-editor-container/documentEditorSettingsModel/#allowdraganddrop) property is `true`.
N> The default value of [`allowDragAndDrop`](https://ej2.syncfusion.com/react/documentation/api/document-editor-container/documentEditorSettingsModel/#allowdraganddrop) property is `true`.

The following example illustrates to disable the drag and drop option in DocumentEditor.
The following example illustrates how to disable the drag and drop option in the Document Editor.

```typescript
var settings = { allowDragAndDrop: false };
var hostUrl = 'https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/';
const settings = { allowDragAndDrop: false };
const hostUrl = 'https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/';

<DocumentEditorComponent id="container" height={'590px'} documentEditorSettings={settings}/>
```

> The Web API hosted link `https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/` utilized in the Document Editor's serviceUrl property is intended solely for demonstration and evaluation purposes. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the [GitHub Web Service example](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) or [Docker image](https://hub.docker.com/r/syncfusion/word-processor-server) for hosting your own web service and use for the serviceUrl property.
N> The Web API hosted link `https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/` utilized in the Document Editor's serviceUrl property is intended solely for demonstration and evaluation purposes. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the [GitHub Web Service example](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) or [Docker image](https://hub.docker.com/r/syncfusion/word-processor-server) for hosting your own web service and use for the serviceUrl property.

>Note: Default value of [`allowDragAndDrop`](https://ej2.syncfusion.com/react/documentation/api/document-editor-container/documentEditorSettingsModel/#allowdraganddrop) property is `true`.
N> The default value of [`allowDragAndDrop`](https://ej2.syncfusion.com/react/documentation/api/document-editor-container/documentEditorSettingsModel/#allowdraganddrop) property is `true`.
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
layout: post
title: Read by default in React Document editor component | Syncfusion
description: Learn here all about Read by default in Syncfusion React Document editor component of Syncfusion Essential JS 2 and more.
control: Read by default
title: Read by default in React DOCX Editor | Syncfusion
description: Learn here all about Read by default in Syncfusion React Document Editor component of Syncfusion Essential JS 2 and more.
control: Read by default
platform: document-processing
documentation: ug
domainurl: ##DomainURL##
---

# Read by default in React Document editor component
# Read by default in React Document Editor component

In this article, we are going to see how to open a document in read only mode by default in [React DOCX Editor](https://www.syncfusion.com/docx-editor-sdk/react-docx-editor) & Document Editor Container.
In this article, we are going to see how to open a document in read-only mode by default in the [React Document Editor](https://www.syncfusion.com/docx-editor-sdk/react-docx-editor) & Document Editor Container.

## Opening a document in read only mode by default in DocumentEditor
## Opening a document in read-only mode by default in DocumentEditor

{% tabs %}
{% highlight js tabtitle="index.jsx" %}
Expand All @@ -28,9 +28,9 @@ In this article, we are going to see how to open a document in read only mode by

{% previewsample "/document-processing/code-snippet/document-editor/react/base-cs4" %}

> The Web API hosted link `https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/` utilized in the Document Editor's serviceUrl property is intended solely for demonstration and evaluation purposes. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the [GitHub Web Service example](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) or [Docker image](https://hub.docker.com/r/syncfusion/word-processor-server) for hosting your own web service and use for the serviceUrl property.
N> The Web API hosted link `https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/` utilized in the Document Editor's serviceUrl property is intended solely for demonstration and evaluation purposes. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the [GitHub Web Service example](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) or [Docker image](https://hub.docker.com/r/syncfusion/word-processor-server) for hosting your own web service and use for the serviceUrl property.

## Opening a document in ready only mode by default in DocumentEditorContainer
## Opening a document in read-only mode by default in DocumentEditorContainer

{% tabs %}
{% highlight js tabtitle="index.jsx" %}
Expand All @@ -46,6 +46,6 @@ In this article, we are going to see how to open a document in read only mode by

{% previewsample "/document-processing/code-snippet/document-editor/react/base-cs5" %}

> The Web API hosted link `https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/` utilized in the Document Editor's serviceUrl property is intended solely for demonstration and evaluation purposes. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the [GitHub Web Service example](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) or [Docker image](https://hub.docker.com/r/syncfusion/word-processor-server) for hosting your own web service and use for the serviceUrl property.
N> The Web API hosted link `https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/` utilized in the Document Editor's serviceUrl property is intended solely for demonstration and evaluation purposes. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the [GitHub Web Service example](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) or [Docker image](https://hub.docker.com/r/syncfusion/word-processor-server) for hosting your own web service and use for the serviceUrl property.

Note: You can use the `restrictEditing` in `DocumentEditorContainerComponent` and `isReadOnly` in `DocumentEditorComponent` based on your requirement to change component to read only mode.
N> You can use the `restrictEditing` in `DocumentEditorContainerComponent` and `isReadOnly` in `DocumentEditorComponent` based on your requirement to change the component to read-only mode.
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
layout: post
title: Resize document editor in React Document editor component | Syncfusion
description: Learn here all about Resize document editor in Syncfusion React Document editor component of Syncfusion Essential JS 2 and more.
control: Resize document editor
title: Resize Document Editor in React DOCX Editor | Syncfusion
description: Learn here all about Resize Document Editor in Syncfusion React Document Editor component of Syncfusion Essential JS 2 and more.
control: Resize Document Editor
platform: document-processing
documentation: ug
domainurl: ##DomainURL##
---

# Resize document editor in React Document editor component
# Resize Document Editor in React Document Editor component

In this article, we are going to see how to change height and width of [React DOCX Editor](https://www.syncfusion.com/docx-editor-sdk/react-docx-editor) (Document Editor).
In this article, we are going to see how to change the height and width of the [React Document Editor](https://www.syncfusion.com/docx-editor-sdk/react-docx-editor) (Document Editor).

## Change height of Document Editor

DocumentEditorContainer initially render with default height. You can change height of documenteditor using [`height`](https://ej2.syncfusion.com/react/documentation/api/document-editor-container/documentEditorContainerModel#height) property, the value which is in pixel.
DocumentEditorContainer initially renders with default height. You can change the height of the Document Editor using the [`height`](https://ej2.syncfusion.com/react/documentation/api/document-editor-container/documentEditorContainerModel#height) property, the value which is in pixels.

The following example code illustrates how to change height of Document Editor.

Expand All @@ -30,15 +30,15 @@ The following example code illustrates how to change height of Document Editor.
/>
```

> The Web API hosted link `https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/` utilized in the Document Editor's serviceUrl property is intended solely for demonstration and evaluation purposes. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the [GitHub Web Service example](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) or [Docker image](https://hub.docker.com/r/syncfusion/word-processor-server) for hosting your own web service and use for the serviceUrl property.
N> The Web API hosted link `https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/` utilized in the Document Editor's serviceUrl property is intended solely for demonstration and evaluation purposes. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the [GitHub Web Service example](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) or [Docker image](https://hub.docker.com/r/syncfusion/word-processor-server) for hosting your own web service and use for the serviceUrl property.

Similarly, you can use [`height`](https://ej2.syncfusion.com/react/documentation/api/document-editor#height) property for DocumentEditor also.

## Change width of Document Editor

DocumentEditorContainer initially render with default width. You can change width of documenteditor using [`width`](https://ej2.syncfusion.com/react/documentation/api/document-editor-container/documentEditorContainerModel#width) property, the value which is in percent.
DocumentEditorContainer initially renders with default width. You can change the width of the Document Editor using the [`width`](https://ej2.syncfusion.com/react/documentation/api/document-editor-container/documentEditorContainerModel#width) property, the value which is in percentages.

The following example code illustrates how to change width of Document Editor.
The following example code illustrates how to change the width of Document Editor.

```ts

Expand All @@ -54,15 +54,15 @@ The following example code illustrates how to change width of Document Editor.

```

> The Web API hosted link `https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/` utilized in the Document Editor's serviceUrl property is intended solely for demonstration and evaluation purposes. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the [GitHub Web Service example](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) or [Docker image](https://hub.docker.com/r/syncfusion/word-processor-server) for hosting your own web service and use for the serviceUrl property.
N> The Web API hosted link `https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/` utilized in the Document Editor's serviceUrl property is intended solely for demonstration and evaluation purposes. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the [GitHub Web Service example](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) or [Docker image](https://hub.docker.com/r/syncfusion/word-processor-server) for hosting your own web service and use for the serviceUrl property.

Similarly, you can use [`width`](https://ej2.syncfusion.com/react/documentation/api/document-editor#width) property for DocumentEditor also.

## Resize Document Editor

Using [`resize`](https://ej2.syncfusion.com/react/documentation/api/document-editor-container#resize) method, you change height and width of Document editor.
Using the [`resize`](https://ej2.syncfusion.com/react/documentation/api/document-editor-container#resize) method, you can change the height and width of the Document Editor.

The following example code illustrates how to fit Document Editor to browser window size.
The following example code illustrates how to fit the Document Editor to the browser window size.

```ts
import { createRoot } from 'react-dom/client';
Expand All @@ -83,7 +83,7 @@ function App() {
window.addEventListener('resize', onWindowResize);
}
function onWindowResize() {
//Resizes the document editor component to fit full browser window automatically whenever the browser resized.
//Resizes the document editor component to fit full browser window automatically whenever the browser is resized.
updateDocumentEditorSize();
}
function updateDocumentEditorSize() {
Expand Down Expand Up @@ -112,4 +112,4 @@ createRoot(document.getElementById('sample')).render(<App />);

```

> The Web API hosted link `https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/` utilized in the Document Editor's serviceUrl property is intended solely for demonstration and evaluation purposes. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the [GitHub Web Service example](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) or [Docker image](https://hub.docker.com/r/syncfusion/word-processor-server) for hosting your own web service and use for the serviceUrl property.
N> The Web API hosted link `https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/` utilized in the Document Editor's serviceUrl property is intended solely for demonstration and evaluation purposes. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the [GitHub Web Service example](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) or [Docker image](https://hub.docker.com/r/syncfusion/word-processor-server) for hosting your own web service and use for the serviceUrl property.
Loading