custom async funtion bug

2 posts, 0 answers
  1. Joaquin
    Joaquin avatar
    2 posts
    Member since:
    Sep 2013

    Posted 06 Jun 2019 Link to this post

    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?

     

     

  2. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1220 posts

    Posted 10 Jun 2019 Link to this post

    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.
Back to Top