This is a migrated thread and some comments may be shown as answers.

custom async funtion bug

1 Answer 13 Views
This is a migrated thread and some comments may be shown as answers.
Joaquin
Top achievements
Rank 1
Joaquin asked on 06 Jun 2019, 11:45 AM

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?

 

 

1 Answer, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 10 Jun 2019, 12:30 PM
Hello Joaquin,

Thank you for the detail information provided on the experienced issue.

We have some issues accessing the liveUrl that you've provided. Nevertheless, here you could find a simple Dojo based on the snippet sent. May I ask you to modify the above so it reproduces the issue observed at your end and send it back to us? This way we will be able to troubleshoot the problem locally and to provide you with the most appropriate assistance on that case.

Regards,
Veselin Tsvetanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Asked by
Joaquin
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Share this question
or