Hyperlink Styles

Posted by: mserban on 10 August 2018, 5:16 am EST

  • Posted 10 August 2018, 5:16 am EST

    Hello,

    We are trying to load a rather large (about 20.000 rows) file in Spread JS. One of the columns is a hyperlink and each of the hyperlink cells has a unique style that looks a bit like this, but we a few other properties like font and borders set.

    {"cellType":
    {"typeName":"8","linkColor":"rgb(0, 0, 255)","visitedLinkColor":"rgb(255, 0, 0)","text":"SpreadJS Web Site","linkToolTip":"SpreadJS Web Site"}}



    Because each cell needs to have a unique text value, we can not reuse the same style for all the column, and this in turn crashes the Chrome tab when it runs out of js memory.

    Is there a way around this? Perhaps taking the text used out of the style property or something like a partial common style, or any other suggestion on how to improve memory consumption?

    Thanks,
  • Marked as Answer

    Replied 13 August 2018, 5:04 am EST

    Hello,

    I would suggest you to set the style for each cell between a isPaintSuspended(true) and isPaintSuspended(false) block. It will stop Spread.Sheets to paint all cells whenever you apply a style to individual cells.

    Thanks,
    Deepak Sharma
  • Replied 21 August 2018, 2:52 pm EST

    Hi Deepak,

    Thanks for the feedback. Unfortunately, it looks like we are already using the suspend/resumePaint methods which I understand are the newer version of isPaintSuspened.


    I've uploaded a sample file that can be used to reproduce our issue at https://trial.obero.net/LargeJson.zip. If you try to use the open option in the Inspector Sample (https://www.grapecity.com/en/demos/spread/JS/InspectorSample/) in Chrome you'll see an error message appear that seems to be related to the large memory usage by Spread.JS. As I've said in my original post, the file itself is very large so the error is not unexpected, but I was wandering if there is anything that could be changed on our side that would improve the performance.

    Thanks,
  • Replied 22 August 2018, 4:59 am EST

    Hello,

    I tried to download the JSON file, but it seems the file is removed from the location. Here is the error message I received while visiting :https://trial.obero.net/LargeJson.zip'

    "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."

    Thanks,
    Deepak Sharma
  • Replied 23 August 2018, 5:17 am EST

    Hi,

    Sorry about that the correct link is https://trial.obero.net/LargeFile.zip

    Looks like it compressed really well so it can actually be attached to this thread as well.

    LargeFile.zip
  • Replied 24 August 2018, 7:50 am EST

    Hello,

    I am able to replicate this issue at my end with the file you provided. I have submitted it as a bug to the development team. I will let you know as soon as I get an update on it.
    The bug id for this issue is #262793

    Thanks,
    Deepak Sharma
  • Replied 28 August 2018, 5:40 am EST

    Hello,

    Developers found that you have too many formulas in your JSON file which is causing the issue here. There are 124147 different formulas. There is a lot of SUMIFS function with a big range, like below:
    "SUMIFS(T$29:T$20549,$S$29:$S$20549,$L5,$EA$29:$EA$20549,1)"

    You can use the code below to optimize the load speed.
    var fromOption = {
    doNotRecalculateAfterLoad: true
    }
    workbook.fromJSON(jsonData, fromOption);

    Thanks,
    Deepak Sharma
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels