Hyperlink Styles

Posted by: mserban on 9 August 2018, 8:16 pm EST

  • Posted 9 August 2018, 8:16 pm EST


    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.

    {"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?

  • Marked as Answer

    Replied 12 August 2018, 8:04 pm EST


    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.

    Deepak Sharma
  • Replied 21 August 2018, 5:52 am 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.

  • Replied 21 August 2018, 7:59 pm EST


    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."

    Deepak Sharma
  • Replied 22 August 2018, 8:17 pm EST


    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.

  • Replied 23 August 2018, 10:50 pm EST


    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

    Deepak Sharma
  • Replied 27 August 2018, 8:40 pm EST


    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:

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

    Deepak Sharma
Need extra support?

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

Learn More

Forum Channels