Hi
I'm creating a custom async function that for some reason bugs out the spreadsheet.
The first few calls work fine, but after a while, the args passed are not the values of the cells, but the code of the cells. I had to use the raw function to test it out. This is what I mean, on the spreadsheet it goes like =getdata(B1,"name",C4,"a") for instance. Which should call the function with values from cell B1 and C4, correct?
Well, it does, for a few calls. Then suddenly it's not the value of B1 what is passed into the call, but "B1" itself.
I wrote this simple test that will print out the error.
You can see it running at:
http://valuation.joaquingrech.com/test
kendo.spreadsheet.defineFunction("getdata", function (callback, args) {
try {
var name = args[1];
var date = args[2];
var ar = json[name];
var mindate = 2012;
if (ar.constructor === Array) {
var index = Number(date) - mindate;
callback(ar[index]);
}
callback(ar);
} catch (e) {
if (!displayed)
alert('error args:'+args+' error:' + e);
displayed = true;
}
});
so how do I fix it?