Posted 28 August 2026, 5:07 am EST
- Updated 28 August 2026, 5:15 am EST
Hi,
Thank you for the clarification and for providing the additional details.
Based on your requirement, we recommend using the built-in Insert Copied Cells / Insert Cut Cells context-menu functionality rather than implementing the operation manually.
The following built-in commands are available for these operations:
InsertCopiedCellsShiftCellsRight
InsertCopiedCellsShiftCellsDown
InsertCutCellsShiftCellsRight
InsertCutCellsShiftCellsDown
When these commands are triggered through the built-in context menu, SpreadJS handles the cell-shifting operation internally.
For your collaboration scenario, using the native functionality is also recommended because the built-in operation is integrated with the collaboration mechanism. This allows the insert/shift operation to be synchronized with other connected users without having to manually calculate the affected ranges or recreate the operation for collaboration. Refer to the attached gif and demo: https://developer.mescius.com/spreadjs/demos/collaboration/login

If you need to monitor when the operation occurs for logging or other application-specific processing, you can check the clipboard events. For example:
// Fires BEFORE insert (can cancel)
spread.bind(GC.Spread.Sheets.Events.ClipboardPasting, (sender, args) => {
if (args.shiftCells !== undefined) {
// args.shiftCells: 0 = right, 1 = down
// args.isCutting: true for cut, false for copy
console.log("Insert copied/cut cells triggered", args);
}
});
// Fires AFTER insert (for post-sync logic)
spread.bind(GC.Spread.Sheets.Events.ClipboardPasted, (sender, args) => {
if (args.shiftCells !== undefined) {
// Operation already synced to other users via collaboration
console.log("Insert completed and synced", args);
}
});
Here, args.shiftCells can be used to determine the shift direction:
0 — Shift Cells Right
1 — Shift Cells Down
Regarding a custom implementation
Although it is possible to implement the behavior manually, we do not recommend doing so for a collaborative scenario. A custom implementation would require you to handle the cell shifting, affected ranges, clipboard state, and synchronization of the operation with other users. It could also require additional handling for scenarios involving merged cells, tables, spans, formulas, and other worksheet features.
Therefore, for your requirement, we recommend using the built-in Insert Copied Cells / Insert Cut Cells commands and relying on the collaboration mechanism to propagate the operation to the other connected users.
If there is a specific limitation with the built-in commands that prevents you from using them in your collaboration implementation, please let us know the exact scenario, and we can investigate it further.
Regards,
Priyam