找回密码
 立即注册

QQ登录

只需一步,快速开始

dexteryao 讲师达人认证 悬赏达人认证 SpreadJS 开发认证

超级版主

123

主题

8927

帖子

1万

积分

超级版主

Rank: 8Rank: 8

积分
13536

讲师达人悬赏达人元老葡萄SpreadJS 认证SpreadJS 高级认证微信认证勋章

dexteryao 讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2021-2-1 15:53  /   查看:2625  /  回复:0
本帖最后由 dexteryao 于 2021-2-3 13:54 编辑

本文说明对于SpreadJS组件设计器弹出的默认对话框如何重定义内容

和工具栏一样,对话框的内容也是通过config配置的,使用getTemplate方法可以获取到已经注册的对话框的配置信息,通过修改配置,重新注册即可.
例如以下代码在插入图表对话框中,插入提示文本

  1. let insertChartDlgTemplate = GC.Spread.Sheets.Designer.getTemplate(DesignerGC.Spread.Sheets.Designer.TemplateNames.InsertChartDlgTemplate)
  2. if(insertChartDlgTemplate){
  3.   //上方插入文字
  4.   insertChartDlgTemplate.content.unshift({type: "TextBlock", text: "文本", margin: "5px 0", style: "color: rgb(226, 107, 29);font-size:18px"})
  5.   //下方插入文字
  6.   insertChartDlgTemplate.content.push({type: "TextBlock", text: "文本", margin: "5px 0", style: "color: rgb(226, 107, 29);font-size:18px"})
  7. GC.Spread.Sheets.Designer.registerTemplate(DesignerGC.Spread.Sheets.Designer.TemplateNames.InsertChartDlgTemplate, insertChartDlgTemplate)
  8. }
复制代码


0 个回复

您需要登录后才可以回帖 登录 | 立即注册
返回顶部