ce
ce copied to clipboard
getValue is never called by the library when using custom column
the example is erroneous:
https://bossanova.uk/jspreadsheet/v4/examples/column-types
also the interface is missing setValue:
interface CustomEditor {
/**
* Event responsible for closing the editor of a cell with a custom editor.
* @param cell - Td tag whose editor should close.
* @param save - If true, the value returned by this event will be the cell's new value. Otherwise, the value returned by this event is ignored.
*/
closeEditor?: (
cell: HTMLTableCellElement,
save: boolean
) => CellValue | undefined;
/**
* Event called when creating new cells.
* @param cell - HTML element prepared to be the new cell.
* @returns HTML element that will be the new cell
*/
createCell?: (cell: HTMLTableCellElement) => HTMLTableCellElement;
/**
* Event responsible for opening the editor of a cell with a custom editor.
* @param cell - Td tag whose editor should open.
* @param el - Root HTML element of this jss instance.
* @param empty - If true, the editor should open with no value.
* @param e - Event that called this method.
*/
openEditor?: (
cell: HTMLTableCellElement,
el: JspreadsheetInstanceElement,
empty: boolean | undefined,
e: TouchEvent | undefined
) => void;
/**
* Event called before changing the value of a cell.
*
* The returned value will be the cell's new value.
* @param cell - Cell whose value has changed.
* @param value - New value.
* @param force - If true, the change is configured to occur even in read-only cells.
*/
updateCell?: (
cell: HTMLTableCellElement,
value: CellValue | undefined,
force: boolean | undefined
) => CellValue | undefined;
}