找回密码
 立即注册

QQ登录

只需一步,快速开始

求学者-X

注册会员

8

主题

19

帖子

63

积分

注册会员

积分
63
求学者-X
注册会员   /  发表于:2021-5-18 18:40  /   查看:2179  /  回复:1
function navigationLeft(){
        window.open("https://www.baidu.com");
}

function showData(d, callback) {
    console.log(d);
    sheet.suspendPaint();
        var h1 = new spreadNS.CellTypes.HyperLink();
        //h1.text("SpreadJS Overview");
        h1.command(navigationLeft());
        sheet.setCellType(12, 2, h1);
        sheet.getCell(12, 2).hAlign(spreadNS.HorizontalAlign.center);
}
为h1添加的command事件报错 而且command添加的链接在打开表格后1秒内自动跳转打开,请问怎么写才能让command事件再单击后才打开

1 个回复

倒序浏览
Derrick.Jiao讲师达人认证 悬赏达人认证 SpreadJS 开发认证
论坛元老   /  发表于:2021-5-19 08:57:38
沙发
建议您使用以下方式添加超链接命令
  1. sheet.setValue(11,0,"超链接")
  2. sheet.setHyperlink(11, 0, { command: function (sheet) {
  3.              window.open("https://www.baidu.com");
  4.         }});
复制代码


回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部