Skip to content

Commit 2c57dcc

Browse files
933810:Added the enableTrackChanges feature document-level settings Content information in Core and MVC
1 parent 8cb3ea3 commit 2c57dcc

File tree

7 files changed

+72
-0
lines changed

7 files changed

+72
-0
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: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ 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+
{% include code-snippet/document-editor-container/track-changes/document-editor.cs %}
2627
{% endhighlight %}{% endtabs %}
2728

2829
{% elsif page.publishingplatform == "aspnet-mvc" %}
@@ -32,9 +33,34 @@ The following example demonstrates how to enable track changes.
3233
{% include code-snippet/document-editor-container/track-changes/razor %}
3334
{% endhighlight %}
3435
{% highlight c# tabtitle="Track-changes-only.cs" %}
36+
{% include code-snippet/document-editor-container/track-changes/document-editor.cs %}
3537
{% endhighlight %}{% endtabs %}
3638
{% endif %}
3739

40+
>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.
41+
42+
{% if page.publishingplatform == "aspnet-core" %}
43+
44+
{% tabs %}
45+
{% highlight cshtml tabtitle="CSHTML" %}
46+
{% include code-snippet/document-editor-container/track-changes-default/tagHelper %}
47+
{% endhighlight %}
48+
{% highlight c# tabtitle="Track-changes-default.cs" %}
49+
{% include code-snippet/document-editor-container/track-changes-default/document-editor.cs %}
50+
{% endhighlight %
51+
}{% endtabs %}
52+
53+
{% elsif page.publishingplatform == "aspnet-mvc" %}
54+
55+
{% tabs %}
56+
{% highlight razor tabtitle="CSHTML" %}
57+
{% include code-snippet/document-editor-container/track-changes-default/razor %}
58+
{% endhighlight %}
59+
{% highlight c# tabtitle="Track-changes-default.cs" %}
60+
{% include code-snippet/document-editor-container/track-changes-default/document-editor.cs %}
61+
{% endhighlight %}
62+
{% endtabs %}
63+
{% endif %}
3864
## Show/Hide Revisions Pane
3965

4066
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,6 +74,7 @@ The following example code illustrates how to show/hide the revisions pane.
4874
{% include code-snippet/document-editor-container/toggle-track-pane/tagHelper %}
4975
{% endhighlight %}
5076
{% highlight c# tabtitle="Track-changes-only.cs" %}
77+
{% include code-snippet/document-editor-container/toggle-track-pane/document-editor.cs %}
5178
{% endhighlight %}{% endtabs %}
5279

5380
{% elsif page.publishingplatform == "aspnet-mvc" %}
@@ -57,6 +84,7 @@ The following example code illustrates how to show/hide the revisions pane.
5784
{% include code-snippet/document-editor-container/toggle-track-pane/razor %}
5885
{% endhighlight %}
5986
{% highlight c# tabtitle="Track-changes-only.cs" %}
87+
{% include code-snippet/document-editor-container/toggle-track-pane/document-editor.cs %}
6088
{% endhighlight %}{% endtabs %}
6189
{% endif %}
6290

@@ -148,6 +176,7 @@ The following example code illustrates how to enforce and stop protection in Doc
148176
{% include code-snippet/document-editor-container/track-changes-only-protect/tagHelper %}
149177
{% endhighlight %}
150178
{% highlight c# tabtitle="Track-changes-only.cs" %}
179+
{% include code-snippet/document-editor-container/track-changes-only-protect/document-editor.cs %}
151180
{% endhighlight %}{% endtabs %}
152181

153182
{% elsif page.publishingplatform == "aspnet-mvc" %}
@@ -157,6 +186,7 @@ The following example code illustrates how to enforce and stop protection in Doc
157186
{% include code-snippet/document-editor-container/track-changes-only-protect/razor %}
158187
{% endhighlight %}
159188
{% highlight c# tabtitle="Track-changes-only.cs" %}
189+
{% include code-snippet/document-editor-container/track-changes-only-protect/document-editor.cs %}
160190
{% endhighlight %}{% endtabs %}
161191
{% endif %}
162192

0 commit comments

Comments
 (0)