Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

If you have functions that you use on a regular basis that are not in the built-in functions or if you wish to combine some of the built-in functions into a single function, you can do so by defining your own custom functions. They can be called as you would call any of the built-in functions.
Using Code
This example creates a custom function.

JavaScript

Copy Code

var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3});var activeSheet = spread.getActiveSheet();// Add Custom function// Type =myfunc(1)// in a cell to see the resultfunction myfunc() {}myfunc.prototype = new GC.Spread.CalcEngine.Functions.Function("myfunc", 0, 0, {name: "myfunc",description: "This is my first function"});myfunc.prototype.evaluate = function (args) {    return 100;spread.addCustomFunction(new myfunc());

 


  • No labels