How to import feature which are need for spread-sheet to reduce bundle size

Posted by: jekin.desai on 17 August 2020, 12:28 am EST

    • Post Options:
    • Link

    Posted 17 August 2020, 12:28 am EST

    Hi,

    Currently i am having using license version of spreadJS for angular v10 application.Everything is working fine except the issue is with the library size which cause the app size to exceed the budget size ~2MB( App has minimum source code)

    In component, spread sheet is imported using : '```

    import * as GC from '@grapecity/spread-sheets

  • Posted 18 August 2020, 2:13 am EST

    Hi Jekin,

    We are sorry currently we do not support importing individual modules using the npm. but We could load SpreadJS sub-libraries to only certain features as explained in the following document: https://www.grapecity.com/spreadjs/docs/v13/online/modules.html

    Regards

  • Posted 18 August 2020, 4:09 pm EST

    Can you give an example how to load SpreadJS sub-libraries in angular app (sample demo, which will be beneficial for all member who are using spreadJS in angular app)? and also url from where i can download .js files which are mentioned in above link

  • Posted 19 August 2020, 3:02 am EST

    Hi,

    We are sorry As of the current version we can not import the specific module using npm. but we are continuously working on this case. We shall let you know regarding this as soon as possible.

    Regards

  • Posted 19 August 2020, 11:49 pm EST

    Any ETA or version number planned in which this feature will be release?

    Also, is there any way to extract all data present in spreadsheet(including hidden column) into an array form the way it was parsed?

    Suppose i am passing ‘users’ has a data source to worksheet

    [dataSource]="users"
    . now let’s say someone modify lots of columns, i don’t to capture event for each editing done and store the new value,instead i want whole user object at one go. something like ```

    getDataSource()

  • Posted 20 August 2020, 1:25 am EST

    Hi Jekin,

    This feature is already in our backlog(SJS-3005). We are sorry but currently, we do not have an ETA. I’ve added you as a correspondent for the case and will let you know about updates regarding the same.

    Regarding getting the modified data, SJS actually have a getDataSource method which you could use to get the modified data of a particular sheet. Please refer to the following code snippet and let us know if you face any issues.

    var test = [

    { Series0: 2, Series1: 1 },

    { Series0: 4, Series1: 2 },

    { Series0: 3, Series1: 4 }

    ];

      sheet.setDataSource(test)
    //change the value of A1 Cell
      sheet.getCell(0, 0).value(5);
      console.log(sheet.getDataSource());
    

    for more information please refer to the following API references:

    getDataSource: https://www.grapecity.com/spreadjs/docs/v13/online/SpreadJS~GC.Spread.Sheets.Worksheet~getDataSource.html

    Regards

  • Posted 20 August 2020, 5:26 pm EST

    Thank you Avinash!

    sheet.getDataSource()
    ``` is working as expected.
    
    1. Is there any i can make specific row non-editable/lock? (no editing,no drag-drop,no copy-paste,no delete,no drag fill,no EditFormula) no action can be performed on that row but filter and sorting should work.
    
    It should also handle scenario let's say where alternate rows are non- editable/lock and when i do drag-fill the non-editable row values remains same but editable row value are changed accordingly.
    
    2. And is there any simpler way to make entire sheet non-editable/lock instead of capturing event of 
    

    EditStarting,ClipboardPasting

    and setting options as false like 
    
    

    this.spread.options.allowCopyPasteExcelStyle = false;

    this.spread.options.allowExtendPasteRange = false;

    this.spread.options.allowUndo = false;

    this.spread.options.allowUserDragDrop = false;

    this.spread.options.allowUserEditFormula = false;

    this.spread.options.allowUserDragFill = false;

    
    Regards
  • Posted 20 August 2020, 10:01 pm EST

    Hi,

    I got the above query solved using ```

    isProtected, locked() and protectionOptions.

    
    Thanks,
    Jekin
  • Posted 21 August 2020, 1:04 am EST

    Hi Jekin,

    We are glad that you were able to find solution for your query. Thank you for informing us about the same.

    Regards

Need extra support?

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

Learn More

Forum Channels