having problems with fromJSON method

6 posts, 0 answers
  1. Hema
    Hema avatar
    20 posts
    Member since:
    Jul 2015

    Posted 08 Mar Link to this post

    I am trying to use spreadsheet.fromJSON method and getting this error.

     

    Uncaught TypeError: Cannot read property 'start' of undefinede.support.browser.msie.e.support.browser.version.e.Class.extend.visible @ kendo.all.min.ext:80e.support.browser.msie.e.support.browser.version.e.Class.extend.visible @ kendo.all.min.ext:80e.support.browser.msie.e.support.browser.version.e.Class.extend.view @ kendo.all.min.ext:80e.support.browser.msie.e.support.browser.version.e.Class.extend.render @ kendo.all.min.ext:79(anonymous function) @ kendo.all.min.ext:79e.support.browser.msie.e.support.browser.version.e.Class.extend.render @ kendo.all.min.ext:79e.support.browser.msie.e.support.browser.version.e.ui.Widget.extend.refresh @ kendo.all.min.ext:85e.support.browser.msie.e.support.browser.version.e.ui.Widget.extend._workbookChange @ kendo.all.min.ext:85i.extend.trigger @ kendo.all.min.ext:25e.support.browser.msie.e.support.browser.version.e.Observable.extend._sheetChange @ kendo.all.min.ext:78i.extend.trigger @ kendo.all.min.ext:25e.support.browser.msie.e.support.browser.version.e.Observable.extend.triggerChange @ kendo.all.min.ext:76e.support.browser.msie.e.support.browser.version.e.Observable.extend.activeSheet @ kendo.all.min.ext:78e.support.browser.msie.e.support.browser.version.e.ui.Widget.extend.activeSheet @ kendo.all.min.ext:85e.support.browser.msie.e.support.browser.version.e.ui.Widget.extend.fromJSON @ kendo.all.min.ext:85(anonymous function) @ fire @ jquery-1.11.1.js:3119self.fireWith @ jquery-1.11.1.js:3231done @ jquery-1.11.1.js:9275callback @ jquery-1.11.1.js:9685

     

    This is my response from the rest call .

    [{"name":"2AChart","selection":null,"activeCell":null,"frozenRows":0,"frozenColumns":0,"rows":[{"index":0,"width":40,"cells":[{"format":"","background":"#91897E","color":"#ffffff","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":0,"value":"Calendar Year Performance Name"},{"format":"","background":"#91897E","color":"#ffffff","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":9,"value":"2007"},{"format":"","background":"#91897E","color":"#ffffff","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":8,"value":"2008"},{"format":"","background":"#91897E","color":"#ffffff","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":7,"value":"2009"},{"format":"","background":"#91897E","color":"#ffffff","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":6,"value":"2010"},{"format":"","background":"#91897E","color":"#ffffff","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":5,"value":"2011"},{"format":"","background":"#91897E","color":"#ffffff","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":4,"value":"2012"},{"format":"","background":"#91897E","color":"#ffffff","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":3,"value":"2013"},{"format":"","background":"#91897E","color":"#ffffff","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":2,"value":"2014"},{"format":"","background":"#91897E","color":"#ffffff","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":1,"value":"2015"}]},{"index":1,"width":40,"cells":[{"format":null,"background":"#E9E7E5","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":0,"value":null},{"format":null,"background":"#E9E7E5","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":1,"value":null},{"format":null,"background":"#E9E7E5","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":2,"value":null},{"format":null,"background":"#E9E7E5","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":3,"value":null},{"format":null,"background":"#E9E7E5","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":4,"value":null},{"format":null,"background":"#E9E7E5","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":5,"value":null},{"format":null,"background":"#E9E7E5","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":6,"value":null},{"format":null,"background":"#E9E7E5","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":7,"value":null},{"format":null,"background":"#E9E7E5","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":8,"value":null},{"format":null,"background":"#E9E7E5","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":9,"value":null},{"format":"","background":"#E9E7E5","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":0,"value":"Tuttle Tactical Management US Core ETF"}]},{"index":2,"width":40,"cells":[{"format":"_(0.00_);[Red](0.00)","background":"#ffffff","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":0,"value":-9.32},{"format":null,"background":"#ffffff","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":1,"value":null},{"format":null,"background":"#ffffff","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":2,"value":null},{"format":null,"background":"#ffffff","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":3,"value":null},{"format":null,"background":"#ffffff","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":4,"value":null},{"format":null,"background":"#ffffff","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":5,"value":null},{"format":null,"background":"#ffffff","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":6,"value":null},{"format":null,"background":"#ffffff","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":7,"value":null},{"format":null,"background":"#ffffff","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":8,"value":null},{"format":null,"background":"#ffffff","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":9,"value":null},{"format":"","background":"#ffffff","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":0,"value":"WBI Tactical SMG Shares ETF"}]},{"index":3,"width":40,"cells":[{"format":"_(0.00_);[Red](0.00)","background":"#E9E7E5","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":0,"value":-8.31},{"format":"_(0.00_);[Red](0.00)","background":"#E9E7E5","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":1,"value":1.08},{"format":"_(0.00_);[Red](0.00)","background":"#E9E7E5","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":2,"value":8.43},{"format":null,"background":"#E9E7E5","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":3,"value":null},{"format":null,"background":"#E9E7E5","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":4,"value":null},{"format":null,"background":"#E9E7E5","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":5,"value":null},{"format":null,"background":"#E9E7E5","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":6,"value":null},{"format":null,"background":"#E9E7E5","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":7,"value":null},{"format":null,"background":"#E9E7E5","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":8,"value":null},{"format":null,"background":"#E9E7E5","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":9,"value":null},{"format":"","background":"#E9E7E5","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":0,"value":"YieldShares High Income ETF"}]},{"index":4,"width":40,"cells":[{"format":"_(0.00_);[Red](0.00)","background":"#ffffff","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":0,"value":-0.99},{"format":"_(0.00_);[Red](0.00)","background":"#ffffff","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":1,"value":6.01},{"format":"_(0.00_);[Red](0.00)","background":"#ffffff","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":2,"value":22.4},{"format":"_(0.00_);[Red](0.00)","background":"#ffffff","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":3,"value":15.14},{"format":"_(0.00_);[Red](0.00)","background":"#ffffff","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":4,"value":-1.8},{"format":"_(0.00_);[Red](0.00)","background":"#ffffff","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":5,"value":16.95},{"format":"_(0.00_);[Red](0.00)","background":"#ffffff","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":6,"value":26.35},{"format":null,"background":"#ffffff","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":7,"value":null},{"format":null,"background":"#ffffff","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":8,"value":null},{"format":null,"background":"#ffffff","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":9,"value":null},{"format":"","background":"#ffffff","color":"#000000","fontSize":13,"bold":false,"textAlign":"center","verticalAlign":"center","index":0,"value":"iShares Core Aggressive Allocation"}]}],"columns":[{"index":0,"width":120},{"index":1,"width":120},{"index":2,"width":120},{"index":3,"width":120},{"index":4,"width":120},{"index":5,"width":120},{"index":6,"width":120},{"index":7,"width":120},{"index":8,"width":120},{"index":9,"width":120},{"index":10,"width":120}],"mergedCells":null}]

    and the request and response header is 

     

    HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Vary: Accept-Encoding Content-Encoding: gzip Content-Type: application/json Content-Length: 701 Date: Tue, 08 Mar 2016 22:26:32 GMT
    Request Headersview source
    Accept:
    application/json, text/javascript, */*; q=0.01
    Accept-Encoding:
    gzip, deflate, sdch
    Accept-Language:
    en-US,en;q=0.8
    Connection:
    keep-alive
    Host:
    localhost:8080
    Referer:
    http://localhost:8080/product-connect-app/
    User-Agent:
    Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36
    X-Requested-With:
    XMLHttpRequest

    Initially , I tried to set to use the data() property of the datasource for the fromJSON method . and then I tried

    $.getJSON('rest/reporting/testing.json').done(function (sheet) {
                        spreadsheet.fromJSON({ sheets: sheet })
                    });

    However both the options failed and generated the error above .  However, if the paste the response as a string in sheets : "....." works . Please advice.

  2. Hema
    Hema avatar
    20 posts
    Member since:
    Jul 2015

    Posted 10 Mar Link to this post

    I tried to use the fromJSON method of sheet and I am able to see the data . I still don't know why the spreadsheet "fromJSON" method doesn't work . However, in the grid, the scroll bars doesn't appear in the grid automatically and throws an error "Uncaught TypeError: Cannot read property '_grid' of undefinede.Class.extend.autoScroll @ kendo.all.min.ext:79" when I tried to resize columns before clicking on the grid first.
  3. Kendo UI is VS 2017 Ready
  4. Hema
    Hema avatar
    20 posts
    Member since:
    Jul 2015

    Posted 10 Mar in reply to Hema Link to this post

    forgot to copy the code snippet  .

    var sheet = spreadsheet.sheetByIndex(0);
    sheet.fromJSON({
    name : gridData.name,
    frozenRows : gridData.frozenRows,
    frozenColumns : gridData.frozenColumns,
    rows : gridData.rows,
    columns : gridData.columns
    });// sheet json

     

  5. T. Tsonev
    Admin
    T. Tsonev avatar
    2770 posts

    Posted 11 Mar Link to this post

    Hi,

    Please accept my apologies for the delayed response.

    The JSON appears to contain an array of sheet data. The fromJSON method expects what would be one element from this array.

    It's not clear from the snippet if this is how it's being used. I've prepared a snippet in the Dojo and the data seems to be loading.

    I hope this helps.

    Regards,
    T. Tsonev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. Hema
    Hema avatar
    20 posts
    Member since:
    Jul 2015

    Posted 15 Mar in reply to T. Tsonev Link to this post

    Tsonev,

    My problem is with the spreadsheet's ( sheets property) fromJSON method. The json works if declared locally as given in the dojo or if I tried to use the sheet's fromJSON method . My problem is with the REST call for the same JSON in the dojo . Here is my code snippet . I am using the kendo 2016.1.112 version.

    $.getJSON('rest/reporting/testing.json').done(function (sheet) {
                        spreadsheet.fromJSON({ sheets: sheet })
                    });

    and the error message that I got is

    Uncaught TypeError: Cannot read property 'start' of undefinede.support.browser.msie.e.support.browser.version.e.Class.extend.visible @ kendo.all.min.ext:80e.support.browser.msie.e.support.browser.version.e.Class.extend.visible @

    Thanks,
    Hema

  7. T. Tsonev
    Admin
    T. Tsonev avatar
    2770 posts

    Posted 17 Mar Link to this post

    Hello,

    I tried reproducing this by issuing an actual request for the data. See the updated snippet.

    This error message is popping up in a few support threads, but I still don't have a reliable reproduction case for it.

    Regards,
    T. Tsonev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready