You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Spreadsheet component triggers events for creation, data binding, selection, editing, clipboard actions, sorting, filtering, formatting, row and column insertion or deletion, context menu and ribbon interactions, and import/export operations—enabling integration of custom logic into application workflows.
13
13
14
-
## actionBegin
14
+
## Action Events
15
+
16
+
The `actionBegin` and `actionComplete` events are the primary action events in the Spreadsheet.
17
+
18
+
The `actionBegin` event triggers when any action begins in the Spreadsheet and fires for all user-initiated actions, enabling you to identify the action type, prevent specific actions from executing, and apply custom logic at the initiation of an action.
19
+
20
+
The `actionComplete` event triggers when any action completes in the Spreadsheet and fires for all user-initiated actions, enabling you to identify the action type and apply custom logic after an action has successfully completed.
21
+
22
+
You can identify the type of action being triggered by using the `args.action` property during both the action events.
23
+
24
+
The following table represents the action names for which the `actionBegin` and `actionComplete` events are triggered in the Spreadsheet:
The following code example demonstrates how to bind the `actionBegin` and `actionComplete` events in the Spreadsheet.
15
80
16
-
The `actionBegin` event triggers when any action begins in the spreadsheet. This event fires for all user-initiated actions, enabling you to identify the action type, prevent specific actions from executing, and apply custom logic at the initiation of an action.
{% include code-snippet/spreadsheet/react/events/app/app.jsx %}
45
84
{% endhighlight %}
46
-
{% endtabs %}
47
-
48
-
## actionComplete
49
-
50
-
The `actionComplete` event triggers when any action completes in the spreadsheet. This event fires for all user-initiated actions, enabling you to identify the action type and apply custom logic after an action has successfully completed.
When performing clipboard operations such as **Cut**, **Copy**, or **Paste**, the spreadsheet triggers specific events that allow users to monitor and manage these actions effectively. The following sections outline the event sequence and their roles.
94
+
When performing clipboard operations such as **Cut**, **Copy**, or **Paste**, the Spreadsheet triggers specific events that allow you to monitor and manage these actions effectively. The following sections outline the event sequence and their roles.
85
95
86
-
**Cut / Copy**
96
+
### Cut / Copy
87
97
88
-
For **Cut** or **Copy** actions, only the [`actionBegin`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#actionbegin) event is triggered. You can identify the type of action and access the copied range using the following properties:
98
+
For **Cut** or **Copy** actions, only the [`actionBegin`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#actionbegin) event is triggered. You can identify the action type and access the copied range by using the following properties:
89
99
90
100
*`args.action === 'cut'` → Indicates a Cut action
91
101
*`args.action === 'copy'` → Indicates a Copy action
92
-
*`args.args.copiedRange` → Provides the copied range
102
+
*`args.args.copiedRange` → Provides the range of copied cells
93
103
94
-
**Paste**
104
+
### Paste
95
105
96
106
During a **Paste** operation, events are triggered in the following sequence:
97
107
@@ -102,70 +112,30 @@ The table below describes each event and its role in the paste process:
|[`actionBegin`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#actionbegin)| Triggers when the paste action starts. |[`ActionBeginEventArgs`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#actionbegin)|
105
-
|[`beforeCellUpdate`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#beforecellupdate)| Triggers for each cell in the pasted range before it is updated, allowing modification and cancelling`paste` action. |[`BeforeCellUpdateArgs`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/beforecellupdateargs)|
115
+
|[`beforeCellUpdate`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#beforecellupdate)| Triggers for each cell in the pasted range before it is updated, allowing you to modify cell properties or cancel the`paste` action. |[`BeforeCellUpdateArgs`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/beforecellupdateargs)|
106
116
|[`cellSave`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#cellsave)| Triggers for each cell in the pasted range after the modified cell is saved. |[`CellSaveEventArgs`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/cellsaveeventargs)|
107
117
|[`actionComplete`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#actioncomplete)| Triggers after all pasted cells are fully saved. |[`ActionCompleteEventArgs`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#actioncomplete)|
108
118
109
-
**Accessing clipboard properties**
119
+
### Accessing copied and pasted ranges
110
120
111
-
You can access clipboard-related properties such as the copied and pasted ranges during paste operations using the [`actionBegin`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#actionbegin) and [`actionComplete`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#actioncomplete) events. Verify the action type using:
121
+
You can access the copied and pasted ranges during paste operations by using the [`actionBegin`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#actionbegin) and [`actionComplete`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#actioncomplete) events. Verify the action type using:
112
122
113
-
*`args.action === 'clipboard'` → Indicates a paste action.
123
+
*`args.action === 'clipboard'` → Indicates a paste action
114
124
115
125
Once verified, you can access the following properties:
116
126
117
127
*`args.eventArgs.copiedRange` → The range of cells that were copied
118
-
*`args.eventArgs.pastedRange` → The range of cells where the content was pasted
119
-
120
-
The following code example showcases the events triggered during clipboard operations in the spreadsheet.
121
-
{% tabs %}
122
-
{% highlight ts tabtitle="app.tsx" %}
123
-
124
-
import * as React from 'react';
125
-
import { createRoot } from 'react-dom/client';
126
-
import { SpreadsheetComponent } from '@syncfusion/ej2-react-spreadsheet';
*`args.eventArgs.pastedRange` → The range of cells where content was pasted
160
129
161
130
## Editing
162
131
163
-
When a cell is edited manually—such as by **double-clicking the cell**, **pressing the F2 key**, or **modifying it through the formula bar**—the spreadsheet triggers a series of events. These events allow users to monitor and manage the entire editing process, from initiation to completion.
132
+
When a cell is edited manually—such as by **double-clicking the cell**, **pressing the F2 key**, or **modifying it through the formula bar**—the Spreadsheet triggers a series of events. These events allow you to monitor and manage the entire editing process, from initiation to completion.
164
133
165
134
The sequence of events during manual cell editing is:
@@ -178,63 +148,6 @@ The table below lists each event and its role in the editing process:
178
148
|[`cellEdited`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#celledited)| Triggers after the editing process completes. |[`CellEditedEventArgs`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/cellediteventargs)|
179
149
|[`actionComplete`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#actioncomplete)| Triggers once the entire edit operation is completed. |[`ActionCompleteEventArgs`](https://ej2.syncfusion.com/react/documentation/api/spreadsheet/index-default#actioncomplete)|
180
150
181
-
The following code example showcases the events triggered during cell editing in the spreadsheet.
182
-
183
-
{% tabs %}
184
-
{% highlight ts tabtitle="app.tsx" %}
185
-
import * as React from 'react';
186
-
import { createRoot } from 'react-dom/client';
187
-
import { SpreadsheetComponent } from '@syncfusion/ej2-react-spreadsheet';
0 commit comments