Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getValue is never called by the library when using custom column #1708

Open
collmomo opened this issue Oct 22, 2024 · 1 comment
Open

getValue is never called by the library when using custom column #1708

collmomo opened this issue Oct 22, 2024 · 1 comment

Comments

@collmomo
Copy link

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;
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@collmomo and others