Skip to content

Commit 08fb6dc

Browse files
author
pipeline
committed
feature(EJ2-3951): Editing samples added.
1 parent a15ba77 commit 08fb6dc

9 files changed

+55
-21
lines changed

src/grid/batch-editing-plnkr.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/grid/batch-editing.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class BatchEditComponent implements OnInit {
2020
public ngOnInit(): void {
2121
this.data = orderDatas;
2222
this.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'batch' };
23-
this.toolbar = ['add', 'edit', 'delete', 'update', 'cancel'];
23+
this.toolbar = ['add', 'delete', 'update', 'cancel'];
2424
this.orderidrules = { required: true };
2525
this.customeridrules = { required: true };
2626
this.freightrules = { required: true };

src/grid/batch-editing.html

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,32 @@
55
<e-column field='CustomerID' headerText='Customer ID' width='120' textAlign="right" [validationRules]='customeridrules'></e-column>
66
<e-column field='Freight' headerText='Freight' width='120' format='C2' textAlign="right" editType='numericedit' [validationRules]='freightrules'></e-column>
77
<e-column field='ShipName' headerText='Ship Name' width='170'></e-column>
8-
<e-column field='ShipCountry' headerText='Ship Country' width='150' editType='dropdownedit' [edit]='editparams' ></e-column>
8+
<e-column field='ShipCountry' headerText='Ship Country' width='150' editType='dropdownedit' [edit]='editparams'></e-column>
99
</e-columns>
1010
</ej-grid>
1111
<div id="description">
12+
<p> The Grid supports CRUD operations. This CRUD operations can be configured in Grid using
13+
<code><a target="_blank" class="code" href="http://ej2.syncfusion.com/angular/documentation/grid/api-editSettings.html">
14+
editSettings</a></code>. Also, It has different modes to manipulate the datasource.
15+
</p>
16+
<p>The available modes are,</p>
17+
<ul>
18+
<li><code>Inline</code></li>
19+
<li><code>Dialog</code></li>
20+
<li><code>Batch</code></li>
21+
</ul>
1222
<p>
13-
Batch editing mode is used to send bulk request (add, update and delete) to Grid. You can start editing by double clicking
14-
a cell and can change cell value. Edited cell will be highlighted while navigating to next cell or any other
15-
row, so that you know which fields or cells has been edited.
23+
In this demo, Batch mode is enabled for Editing by defining <code><a target="_blank" class="code"
24+
href="http://ej2.syncfusion.com/angular/documentation/grid/api-editSettings.html#mode-string">
25+
editSettings.mode
26+
</a></code> as <code>batch</code>. You can start editing by double clicking a cell and can change cell value.
27+
The edited cell will be highlighted while navigating to a new cell, so that you know which cells had been edited.
28+
You can bulk save the edited data to datasource by click on the toolbar's <code>update</code> button or by externally
29+
invoking the <code><a target="_blank" class="code"
30+
href="http://ej2.syncfusion.com/angular/documentation/grid/api-edit.html#batchsave">
31+
batchSave
32+
</a></code> method.
1633
</p>
17-
<p>In this demo, batch editing is enabled by defining mode as `batch`.</p>
18-
<br>
1934
<p style="font-weight: 500">Injecting Module</p>
2035
<p>
2136
Grid component features are segregated into individual feature-wise modules. To use editing feature, we need to inject

src/grid/dialog-editing-plnkr.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/grid/dialog-editing.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class DialogEditComponent implements OnInit {
2020
public ngOnInit(): void {
2121
this.data = orderDatas;
2222
this.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'dialog' };
23-
this.toolbar = ['add', 'edit', 'delete', 'update', 'cancel'];
23+
this.toolbar = ['add', 'edit', 'delete'];
2424
this.orderidrules = { required: true };
2525
this.customeridrules = { required: true };
2626
this.freightrules = { required: true };

src/grid/dialog-editing.html

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,23 @@
99
</e-columns>
1010
</ej-grid>
1111
<div id="description">
12+
<p> The Grid supports CRUD operations. This CRUD operations can be configured in Grid using
13+
<code><a target="_blank" class="code" href="http://ej2.syncfusion.com/angular/documentation/grid/api-editSettings.html">
14+
editSettings</a></code>. Also, It has different modes to manipulate the datasource.
15+
</p>
16+
<p>The available modes are,</p>
17+
<ul>
18+
<li><code>Inline</code></li>
19+
<li><code>Dialog</code></li>
20+
<li><code>Batch</code></li>
21+
</ul>
1222
<p>
13-
Dialog Editing is used to edit rows through dialog component. You can start editing by double clicking a row or toolbar `Edit`
14-
button and then you can change the row values.
23+
In this demo, Dialog mode is enabled for Editing by defining <code><a target="_blank" class="code"
24+
href="http://ej2.syncfusion.com/angular/documentation/grid/api-editSettings.html#mode-string">
25+
editSettings.mode
26+
</a></code> as <code>dialog</code>. You can start editing by double clicking a row or click on toolbar's <code>Edit</code> button, then the currently selected row will be shown on a dialog and you can change the row values and save
27+
edited data to the datasource.
1528
</p>
16-
<p>In this demo, dialog editing is enabled by defining mode as `dialog`.</p>
17-
<br>
1829
<p style="font-weight: 500">Injecting Module</p>
1930
<p>
2031
Grid component features are segregated into individual feature-wise modules. To use editing feature, we need to inject

src/grid/normal-edit-plnkr.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/grid/normal-edit.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class NormalEditComponent implements OnInit {
1919

2020
public ngOnInit(): void {
2121
this.data = orderDatas;
22-
this.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'normal' };
22+
this.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true };
2323
this.toolbar = ['add', 'edit', 'delete', 'update', 'cancel'];
2424
this.orderidrules = { required: true };
2525
this.customeridrules = { required: true };

src/grid/normal-edit.html

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,21 @@
99
</e-columns>
1010
</ej-grid>
1111
<div id="description">
12+
<p> The Grid supports CRUD operations. This CRUD operations can be configured in Grid using
13+
<code><a target="_blank" class="code" href="http://ej2.syncfusion.com/angular/documentation/grid/api-editSettings.html">
14+
editSettings</a></code>. Also, It has different modes to manipulate the datasource.
15+
</p>
16+
<p>The available modes are,</p>
17+
<ul>
18+
<li><code>Inline</code></li>
19+
<li><code>Dialog</code></li>
20+
<li><code>Batch</code></li>
21+
</ul>
1222
<p>
13-
Inline Editing is used to handle CRUD opertions. In Inline Editing mode the row itself is changed as edited row. You can
14-
start editing by double clicking a row or toolbar `Edit` button and then you can change the row values.
23+
In this demo, Inline mode is enabled for Editing. You can start edit any row by double clicking on it or click on toolbar’s
24+
<code>Edit</code> button, then the currently selected row will be changed to edited state. You can change the row values
25+
and save edited data to datasource.
1526
</p>
16-
17-
<p>In this demo, inline editing is enabled by defining mode as `normal`.</p>
18-
<br>
1927
<p style="font-weight: 500">Injecting Module</p>
2028
<p>
2129
Grid component features are segregated into individual feature-wise modules. To use editing feature, we need to inject

0 commit comments

Comments
 (0)