Spreadsheet业务应用端,表样固定了,针对部分可编辑区域单元格值,但是其他如样式、颜色不可改;而不可编辑区域,则所有内容不可变。
目前遇到的问题:1.剪切+粘贴,会将原有单元格样式剪切掉,粘贴的单元格也会带上样式;2.针对不可编辑区域,拖拉生成内容也没有限制。
Hello songyl,
By default spreadsheet has the command special pase → values (right click) which prevents changing styles while pasting values. It triggers event onCommand with the argument [{id:"paste-values"}]
You can apply this logic to your custom hotkey, for example Ctrl+Alt+V.
Please check the example: Code Snippet
Dear Sir:
复则、粘贴显示正常了,但是剪切、粘贴,要求仅剪切内容,而剪切内容没有被剪切掉。这个必须使用自定义快捷键,不能使用Ctrl+V这个来实现吗?
While using special paste, content cutting is disabled by design and according to Excel as well. We will consider this possibility for the future.
To use Ctrl+V instead of Ctrl+Alt+V you can just remove e.altKey from hotkeys check:
if (e.code == "KeyV" && (e.ctrlKey || e.metaKey))
.