Custom CellType Icon with Hyperlink

Posted by: atul.vekariya on 15 January 2021, 12:18 am EST

  • Posted 15 January 2021, 12:18 am EST

    I created a custom CellTypes for Icon. I wanted to add a hyperlink as well.

    sheet.getCell(0, 0).text("Circle text.").cellType(new IconCellType(document.getElementById("icon-lock")));

    Need to add Hyperlink in "Circle text." with Icon.
  • Marked as Answer

    Replied 17 January 2021, 9:02 pm EST

    Hi Atul,

    You may inherit the HyperlinkCellType for the required functionality. Please refer to the following code snippet and let us know if you face any issues.
    export function IconCellType(img) {
    this.typeName = "IconCellType";
    this.img = img;
    IconCellType.prototype = new GC.Spread.Sheets.CellTypes.HyperLink();
    var cellType = new IconCellType(document.getElementById("icon-lock"));
    cellType.text("This is Circle text.");
    cellType.linkToolTip("Company Web Site");

    .getCell(0, 0)
    .text("This is Circle text.")
    sheet.getCell(1, 0).cellType(cellType).value("");

  • Replied 17 January 2021, 9:48 pm EST

    Perfect !!

    Thanks for the quick reply.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels