Re-set spreadsheet options

6 posts, 0 answers
  1. Anna
    Anna avatar
    56 posts
    Member since:
    Jul 2015

    Posted 05 Sep Link to this post

    Hi team,

    How do I change a spreadsheet's options after it's initialized? E.g. I want to change columns width every time I change data fetch. I tried: 

    $("#spreadsheet").data("kendoSpreadsheet").setOptions(newOption);

    This doesn't seems to work at all.

    Best,

     

    Anna

  2. Anna
    Anna avatar
    56 posts
    Member since:
    Jul 2015

    Posted 05 Sep in reply to Anna Link to this post

    I found option to change column width: sheet.columnWidth(index, width);

    However, I'm still interested in changing other options. Like cell formatings.

    Also, wondering if there's ability to set a whole row's or column's format in the options? I know there's ability to set format using range, I can set each cell's format.

  3. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    558 posts

    Posted 07 Sep Link to this post

    Hi Anna,

    Using the setOptions() for altering the formatting of the Spreadsheet rows / cols / cells would not be possible. As you correctly noticed, the Sheet and Range objects methods instead should be used.

    Cell formatting (including for entire row / column) can be performed using the Range object methods. The Kendo API does not expose any additional methods that would allow entire row / column formatting.

    Regards,
    Veselin Tsvetanov
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  4. Anna
    Anna avatar
    56 posts
    Member since:
    Jul 2015

    Posted 07 Sep Link to this post

    Hi Veselin, 

    Thank you for replying. In terms of performance, which will be more costly?

    1. destroy previous spreadsheet, and re-initialize with new options

    2. make numerous( > 5)  range selections to set new styles?

    Best,

     

    Annna

  5. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    558 posts

    Posted 08 Sep Link to this post

    Hi Anna,

    When manipulating the Spreadsheet using the Range object, you could use the Sheet.batch() ​method which would allow you to suppresses triggering of change events for a sequence of actions. Triggers a single change event at the end of the sequence. In such case, playing with the Range objects should be a more appropriate option.

    Regards,
    Veselin Tsvetanov
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  6. Anna
    Anna avatar
    56 posts
    Member since:
    Jul 2015

    Posted 22 Sep Link to this post

    For anyone else with similar problem. I found better solution, use sheet.fromJson(sheetOptions);.
Back to Top