To display a cell’s formatting during edit mode use the setEditorValue method to customize the cells editor value.
Steps to Complete:
1. Create a cell with a custom editor value
2. Set the editor value to display the same value and formatting
Step 1: Create a cell with a custom editor value
Use the setEditorValue method and get the cell value and formatter from the row and column indexes.
Step 2: Set the cells editor value
Set the editor value to display the same value and formatting by first setting the value to be equal to SpreadJS’s the GeneralFormatter class with the returned formatter of the selected cell.
Then call for the custom cell to set the editor with the value that contains the formatting of the cell.
Notice that after adding this the cell editor results with the cells value with formatting where by default SpreadJS will display the value:
This is the Cell Editor by default:
This is SpreadJS with the custom code as described in this article: