Applying css to a cell

Posted by: my.mail.kharkov on 15 January 2018, 12:09 am EST

    • Post Options:
    • Link

    Posted 15 January 2018, 12:09 am EST

    Hey guys.

    It seems that you are using a Style class for styling specific cells in the sheet.

    The problem is that we have to migrate our data from different spreadsheet library. This library used plain css string for cell styles.

    Do you have some css string to Style parser or ability to style a cell with css string directly in fromJSON method?

  • Posted 16 January 2018, 1:14 am EST

    Hello,

    You mentioned that you have used plain css string for cell styles in different spreadsheet library. SpreadJS JSON schema can be found here:

    http://help.grapecity.com/spread/SpreadSheets11/webframe.html#jsonschema.html

    You can probably set the style in schema while fetching the JSON using fromJSON() method.

    In case the issue continues , let me know what strings you used to set style earlier which you are facing problem with.

    Thanks,

    Deepak Sharma

  • Posted 22 January 2018, 11:04 pm EST

    Hey Deepak, thanks for the response.

    I am actually doing exactly what you are saying.

    I am using fromJSON method and mapping previous data to match the requirements of SpreadJS JSON Schema.

    And everything works correctly (actual data of the cell, formulas, column width, etc…) but when I am trying to set my css string to a style property of the cell (as described in Schema) nothing happens. Styles aren’t applying to a cell.

    This is an example of my legacy style string:

    "color: #ff0000; background-color: #ffff00; font-size: 11pt; font-weight: bold; font-style: italic;

    "

    So it seems that I need to convert those strings into Style object supported by SpreadJS Schema, is it correct?

  • Posted 28 January 2018, 7:38 pm EST

    Yes, that is correct. You need to convert the string into a Style object to be used with SpreadJS Json Schema. Please refer to the following link for more information on this - http://help.grapecity.com/spread/SpreadSheets11/webframe.html#jsonschema.html

  • Posted 25 November 2019, 1:14 am EST

    Guys, with the release of SpreadSheets13 this schema is long out-of-date

    The new library will send fields such as “leftCellIndex”, “topCellIndex”, “cellStates” and “autoMergeRangeInfos”. None of these can be found in the link you’ve posted above

    I then went on and found the “current” Schema

    https://www.grapecity.com/spreadjs/docs/v13/online/fullschema11.html

    That’s also out of date relative to the JSON payloads we’re seeing in the wild, sent by the V13 clients

  • Posted 25 November 2019, 10:27 pm EST

    Hi,

    Thank you for reporting the issue. We have escalated it to the concerned team for review and will let you know about any updates regarding the same. Internal tracking Id for the issue is SJS-2671.

    Further, we have asked the team to provide the latest schema and will update you as soon as I hear back from the team.

    Regards

    Sharad

Need extra support?

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

Learn More

Forum Channels