jspreadsheet / jspreadsheet/ce
getValue is never called by the library when using custom column
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 7.2k
- Forks
- 890
- PR merge metrics
- No merged PRs in 30d
Description
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;
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the custom column example at https://bossanova.uk/jspreadsheet/v4/examples/column-types and the CustomEditor interface shown in the issue. Trace how custom-column values are read and written, then verify that getValue is invoked as expected and that the interface exposes the required setValue member.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100