Skip to content

Commit 4418460

Browse files
Added sample for Selective Tools Registration
1 parent 779d3c6 commit 4418460

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml">
3+
<head>
4+
<link href="https://cdn.syncfusion.com/ej2/35.1.40/tailwind3.css" rel="stylesheet">
5+
<script src="https://cdn.syncfusion.com/ej2/35.1.40/dist/ej2.min.js"></script>
6+
</head>
7+
<body>
8+
<!-- Element that renders the DOCX Editor -->
9+
<div id='DocumentEditor'></div>
10+
<script src="index.js" type="text/javascript"></script>
11+
</body>
12+
</html>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Inject required modules
2+
ej.documenteditor.DocumentEditorContainer.Inject(ej.documenteditor.Toolbar, ej.documenteditor.Ribbon);
3+
4+
// Initialize Document Editor Container component with WebMCP enabled
5+
var documenteditorcontainer = new ej.documenteditor.DocumentEditorContainer({
6+
height: '590px',
7+
enableWebMcp: true,
8+
toolbarMode: 'Ribbon',
9+
webMcpSettings: { name: 'container', tools: [ 'getDocumentBookmarks', 'getSelectionText', 'find', 'findAll', 'goToPage' ] } //Register only with needed tools
10+
});
11+
12+
// Use the following service URL only for demo purposes
13+
documenteditorcontainer.serviceUrl = 'https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/';
14+
// Render the DocumentEditorContainer control
15+
documenteditorcontainer.appendTo('#DocumentEditor');

0 commit comments

Comments
 (0)