SpreadJS RIch Text implmentation in Angular 6

Posted by: vinayakbagi on 4 June 2020, 2:58 am EST

  • Posted 4 June 2020, 2:58 am EST

    Hi Team,

    Can you please share demo code for Implement RIch Text feature in Angular 6.

    Thanks and Regards,

    Vinayak

  • Posted 4 June 2020, 11:55 pm EST

    Hi Vinayak,

    Please refer to the following docs and demo which demonstrates how we would use rich text:

    Demo: https://www.grapecity.com/spreadjs/demos/features/cells/basic-rich-text/purejs

    Docs: https://www.grapecity.com/spreadjs/docs/v13/online/SettingRichTextCell.html?highlight=rich%2Ctext%2C

    Further, you may also refer to the following sample which demonstrates the rich text functionality in angular:

    https://stackblitz.com/edit/hello-angular-6-u6cbxt?file=src/app/app.component.ts

    Regards

  • Posted 9 June 2020, 12:24 am EST

    Hi Sharad,

    I went through above code but didn’t find a proper way to implement superscript to selected text. Could you share code specific for this one in angular.

    Thanks and Regards,

    Vinayak

  • Posted 10 June 2020, 12:55 am EST

    Hi Vinayak,

    For making the text superscript you may use vertAlign property and set the vertical alignment to top please refer the following code snippet

    let richText = {richText:
    [
         {
             style: {
                      font: "normal 24px Calibri",
                      vertAlign: GC.Spread.Sheets.VerticalAlign.top
                    },
                    text: text
          },
    ]
    }
    spread.getActiveSheet().setValue(0,0,richText);
    

    Further, we are working on a sample in angular to demostrate the same and will share it with you soon.

    Regards

  • Posted 11 June 2020, 4:58 pm EST

    Please refer to the following sample demonstrating superscript in angular:

    https://codesandbox.io/s/gallant-keller-zz43p?file=/src/app/app.component.ts

    Also, I noticed that my previous reply had an error, instead of VerticalAlign.top, it needs to be VertAlign.superscript:

    let richText = {richText:
    [
         {
             style: {
                      font: "normal 24px Calibri",
                      vertAlign: GC.Spread.Sheets.VertAlign.superscript
                    },
                    text: text
          },
    ]
    }
    
Need extra support?

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

Learn More

Forum Channels