Skip to content

Commit b0529ed

Browse files
Merge pull request #3846 from syncfusion-content/933810-Tc-describ-cm
933810:Added the enableTrackChanges feature document-level settings Content information in Core and MVC
2 parents a2a9d32 + 6927d7d commit b0529ed

File tree

7 files changed

+84
-6
lines changed

7 files changed

+84
-6
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public ActionResult Default()
2+
{
3+
return View();
4+
}
5+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public ActionResult Default()
2+
{
3+
return View();
4+
}
5+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div>
2+
@Html.EJS().DocumentEditorContainer("container").documentChange("onDocChange").EnableToolbar(true).Render()
3+
</div>
4+
5+
<ejs-documenteditorcontainer id="container" documentChange="onDocumentChange" enableToolbar=true serviceUrl="/api/DocumentEditor/" height="590px"></ejs-documenteditorcontainer>
6+
<script>
7+
function onDocumentChange() {
8+
var container = document.getElementById("container").ej2_instances[0];
9+
if(container !== null){
10+
container.documentEditor.enableTrackChanges= true;
11+
}
12+
}
13+
</script>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<ejs-documenteditorcontainer id="container" documentChange="onDocumentChange" enableToolbar=true serviceUrl="/api/DocumentEditor/" height="590px"></ejs-documenteditorcontainer>
2+
<script>
3+
function onDocumentChange() {
4+
var container = document.getElementById("container").ej2_instances[0];
5+
if(container !== null){
6+
container.documentEditor.enableTrackChanges= true;
7+
}
8+
}
9+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public ActionResult Default()
2+
{
3+
return View();
4+
}
5+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public ActionResult Default()
2+
{
3+
return View();
4+
}
5+

ej2-asp-core-mvc/document-editor/track-changes.md

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ The following example demonstrates how to enable track changes.
2323
{% include code-snippet/document-editor-container/track-changes/tagHelper %}
2424
{% endhighlight %}
2525
{% highlight c# tabtitle="Track-changes-only.cs" %}
26-
{% endhighlight %}{% endtabs %}
26+
{% include code-snippet/document-editor-container/track-changes/document-editor.cs %}
27+
{% endhighlight %}
28+
{% endtabs %}
2729

2830
{% elsif page.publishingplatform == "aspnet-mvc" %}
2931

@@ -32,9 +34,35 @@ The following example demonstrates how to enable track changes.
3234
{% include code-snippet/document-editor-container/track-changes/razor %}
3335
{% endhighlight %}
3436
{% highlight c# tabtitle="Track-changes-only.cs" %}
35-
{% endhighlight %}{% endtabs %}
37+
{% include code-snippet/document-editor-container/track-changes/document-editor.cs %}
38+
{% endhighlight %}
39+
{% endtabs %}
3640
{% endif %}
3741

42+
>Track changes are document level settings. When opening a document, if the document does not have track changes enabled, then enableTrackChanges will be disabled even if we set enableTrackChanges = true in the initial rendering. If you want to enable track changes for all the documents, then we recommend enabling track changes during the document change event. The following example demonstrates how to enable Track changes for the all the Document while Opening.
43+
44+
{% if page.publishingplatform == "aspnet-core" %}
45+
46+
{% tabs %}
47+
{% highlight cshtml tabtitle="CSHTML" %}
48+
{% include code-snippet/document-editor-container/track-changes-default/tagHelper %}
49+
{% endhighlight %}
50+
{% highlight c# tabtitle="Track-changes-default.cs" %}
51+
{% include code-snippet/document-editor-container/track-changes-default/document-editor.cs %}
52+
{% endhighlight %}
53+
{% endtabs %}
54+
55+
{% elsif page.publishingplatform == "aspnet-mvc" %}
56+
57+
{% tabs %}
58+
{% highlight razor tabtitle="CSHTML" %}
59+
{% include code-snippet/document-editor-container/track-changes-default/razor %}
60+
{% endhighlight %}
61+
{% highlight c# tabtitle="Track-changes-default.cs" %}
62+
{% include code-snippet/document-editor-container/track-changes-default/document-editor.cs %}
63+
{% endhighlight %}
64+
{% endtabs %}
65+
{% endif %}
3866
## Show/Hide Revisions Pane
3967

4068
The Show/Hide Revisions Pane feature in the Document Editor allows users to toggle the visibility of the revisions pane, providing flexibility in managing tracked changes within the document.
@@ -48,7 +76,9 @@ The following example code illustrates how to show/hide the revisions pane.
4876
{% include code-snippet/document-editor-container/toggle-track-pane/tagHelper %}
4977
{% endhighlight %}
5078
{% highlight c# tabtitle="Track-changes-only.cs" %}
51-
{% endhighlight %}{% endtabs %}
79+
{% include code-snippet/document-editor-container/toggle-track-pane/document-editor.cs %}
80+
{% endhighlight %}
81+
{% endtabs %}
5282

5383
{% elsif page.publishingplatform == "aspnet-mvc" %}
5484

@@ -57,7 +87,9 @@ The following example code illustrates how to show/hide the revisions pane.
5787
{% include code-snippet/document-editor-container/toggle-track-pane/razor %}
5888
{% endhighlight %}
5989
{% highlight c# tabtitle="Track-changes-only.cs" %}
60-
{% endhighlight %}{% endtabs %}
90+
{% include code-snippet/document-editor-container/toggle-track-pane/document-editor.cs %}
91+
{% endhighlight %}
92+
{% endtabs %}
6193
{% endif %}
6294

6395
## Get all tracked revisions
@@ -148,7 +180,9 @@ The following example code illustrates how to enforce and stop protection in Doc
148180
{% include code-snippet/document-editor-container/track-changes-only-protect/tagHelper %}
149181
{% endhighlight %}
150182
{% highlight c# tabtitle="Track-changes-only.cs" %}
151-
{% endhighlight %}{% endtabs %}
183+
{% include code-snippet/document-editor-container/track-changes-only-protect/document-editor.cs %}
184+
{% endhighlight %}
185+
{% endtabs %}
152186

153187
{% elsif page.publishingplatform == "aspnet-mvc" %}
154188

@@ -157,7 +191,9 @@ The following example code illustrates how to enforce and stop protection in Doc
157191
{% include code-snippet/document-editor-container/track-changes-only-protect/razor %}
158192
{% endhighlight %}
159193
{% highlight c# tabtitle="Track-changes-only.cs" %}
160-
{% endhighlight %}{% endtabs %}
194+
{% include code-snippet/document-editor-container/track-changes-only-protect/document-editor.cs %}
195+
{% endhighlight %}
196+
{% endtabs %}
161197
{% endif %}
162198

163199
Tracked changes only protection can be enabled in UI by using [Restrict Editing pane](../document-editor/document-management#restrict-editing-pane/)

0 commit comments

Comments
 (0)