<!DOCTYPE html>
<html>
<head>
<script data-require="jquery@*" data-semver="2.1.1" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link data-require="SpreadJS@*" data-semver="3.20142.13" rel="stylesheet" href="http://cdn.wijmo.com/spreadjs/jquery.wijmo.wijspread.3.20142.13.css" />
<script data-require="SpreadJS@*" data-semver="3.20142.13" src="http://cdn.wijmo.com/spreadjs/jquery.wijmo.wijspread.all.3.20142.13.js"></script>
<script src="script.js"></script>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<h1>Hello SpreadJS!</h1>
<div id="ss" style="width: 800px; height: 500px; border: 1px solid gray"></div>
</body>
</html>
// Initialize SpreadJS
$(document).ready(function() {
var ns = $.wijmo.wijspread;
function EditableHyperLinkCellType() {}
EditableHyperLinkCellType.prototype = new ns.HyperLinkCellType();
EditableHyperLinkCellType.prototype.createEditorElement = function(context) {
return ns.TextCellType.prototype.createEditorElement.apply(this, context);
}
EditableHyperLinkCellType.prototype.activateEditor = function(editorContext, cellStyle, cellRect, context) {
ns.TextCellType.prototype.activateEditor.apply(this, arguments);
}
EditableHyperLinkCellType.prototype.updateEditor = function(editorContext, cellStyle, cellRect, context) {
ns.TextCellType.prototype.updateEditor.apply(this, arguments);
}
EditableHyperLinkCellType.prototype.deactivateEditor = function(editorContext, context) {
ns.TextCellType.prototype.deactivateEditor.apply(this, arguments);
}
EditableHyperLinkCellType.prototype.getEditorValue = function(editorContext, context) {
return ns.TextCellType.prototype.getEditorValue.apply(this, arguments);
}
EditableHyperLinkCellType.prototype.setEditorValue = function(editorContext, value, context) {
ns.TextCellType.prototype.setEditorValue.apply(this, arguments);
}
EditableHyperLinkCellType.prototype.isImeAware = function(context) {
return true;
}
EditableHyperLinkCellType.prototype.focus = function(editorContext, context) {
return ns.TextCellType.prototype.focus.apply(this, arguments);
}
$("#ss").wijspread(); // create wijspread control
var spread = $("#ss").wijspread("spread"); // get instance of wijspread control
var sheet = spread.getActiveSheet(); // get active worksheet of the wijspread control
// initializing the active worksheet here...
sheet.isPaintSuspended(true);
var h = new EditableHyperLinkCellType();
sheet.getCell(2, 2).text("http://www.google.com").cellType(h);
sheet.getColumn(2).width(200);
sheet.isPaintSuspended(false);
});
/* Styles go here */
An editable hyperlink celltype which makes by using HyperLinkCellType and TextCellType combination.