Hufe921 / canvas-editor

rich text editor by canvas/svg
https://hufe.club/canvas-editor-docs
MIT License
3.43k stars 498 forks source link

增加获取表格id的方法 #699

Closed Tiny-Dong closed 1 month ago

Tiny-Dong commented 1 month ago

What problem does this feature solve?

能否支持表格选选区置时 也可以绘制光标效果

20240717122823_rec_

What does the proposed API look like?

能否支持表格选选区置时 也可以绘制光标效果

Hufe921 commented 1 month ago

需要设置上下文信息:executeSetPositionContext

Tiny-Dong commented 1 month ago

需要设置上下文信息:executeSetPositionContext

20240718093422_rec_

@Hufe921 executeSetRange 和 executeSetPositionContext 设置后 光标不会自动渲染 需要重新render

Hufe921 commented 1 month ago

要先设置上下文信息,后执行选区,如:

editor.command.executeSetPositionContext({
    tableId:'a6f1ed25-7de6-921f-5dbc-d2161e711a8d',
    startTrIndex:0,
    startTdIndex:0
})
editor.command.executeSetRange(0,0)

优化获取表格id的方法

Hufe921 commented 1 month ago

增加获取表格id方法:

instance.command.getValue({
        extraPickAttrs: ['id']
      })