Refresh specific cell/panel in FlexSheet

Posted by: holly.anderson on 3 January 2018, 3:52 am EST

    • Post Options:
    • Link

    Posted 3 January 2018, 3:52 am EST

    Hello,

    I have a scenario where I need to modify the background color of a cell in the column footer panel when the value of an input field is modified elsewhere on the page. I’ve noticed that after setting the cell’s background color, I have to refresh the FlexSheet in order for the change to be visible on the screen. Currently, I’m using the refreshCells method. It seems unnecessary to refresh the entire spreadsheet, so I’m wondering if there’s some way to just refresh the specific cell or the column footer panel.

    Thanks,

    Holly

  • Posted 3 January 2018, 5:15 pm EST

    Hi Holly,

    If we are correct, you are using applyCellsStyle method to apply style on cell programatically. This requires to call refresh method.

    You may use the itemFormatter for styling the cell, this will change the style color as you made any change in FlexSheet. But internally, it also use refresh method to get displayed the changes. In this case, you do not need to call extra refresh method used after calling applyCellsStyle method.

    ~Manish

  • Posted 4 January 2018, 11:36 pm EST

    Hi Manish,

    Thanks for the reply. Just to clarify, there’s no way to refresh a specific cell, correct? I’d have to refresh the entire FlexSheet?

    Holly

  • Posted 7 January 2018, 3:15 pm EST

    Hi Holly,

    Yeah, you are correct. You need to refersh complete FlexSheet.

    If you would like to use applyCellsStyle method, you may call it without calling refresh method using following code snippet.

    flexSheet.beginUpdate();
    
    flexSheet.applyCellsStyle(...);
    
    ...
    
    flexSheet.applyCellsStyle(...);
    
    flexSheet.endUpdate();
    

    ~Manish

Need extra support?

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

Learn More

Forum Channels