Type Alias EditOptionsType

EditOptionsType: {
    apply?:
        | null
        | (e: WbNodeEventType & { inputElem: HTMLInputElement }) => any
        | Promise<any>;
    beforeEdit?: null | (e: WbNodeEventType) => boolean | string;
    debounce?: number;
    edit?:
        | null
        | (e: WbNodeEventType & { inputElem: HTMLInputElement }) => void;
    maxlength?: null | number;
    minlength?: number;
    select?: boolean;
    slowClickDelay?: number;
    trigger?: string[];
    trim?: boolean;
    validity?: boolean;
}

Note:
This options are used for renaming node titles.
There is also the tree.change event to handle modifying node data from input controls that are embedded in grid cells.

Type declaration

  • Optionalapply?:
        | null
        | (e: WbNodeEventType & { inputElem: HTMLInputElement }) => any
        | Promise<any>
  • OptionalbeforeEdit?: null | (e: WbNodeEventType) => boolean | string

    beforeEdit(e) may return an input HTML string. Otherwise use a default.

  • Optionaldebounce?: number

    Used to debounce the change event handler for grid cells [ms].

    100
    
  • Optionaledit?: null | (e: WbNodeEventType & { inputElem: HTMLInputElement }) => void
  • Optionalmaxlength?: null | number

    Maximum number of characters allowed for node title input field.

    null;
    
  • Optionalminlength?: number

    Minimum number of characters required for node title input field.

    1
    
  • Optionalselect?: boolean

    Select all text of a node title, so it can be overwritten by typing.

    true
    
  • OptionalslowClickDelay?: number

    Handle 'clickActive' only if last click is less than this ms old (0: always)

    1000
    
  • Optionaltrigger?: string[]

    Array of strings to determine which user input should trigger edit mode. E.g. ["clickActive", "F2", "macEnter"]:
    'clickActive': single click on active node title
    'F2': press F2 key
    'macEnter': press Enter (on macOS only)
    Pass an empty array to disable edit mode.

    []
    
  • Optionaltrim?: boolean

    Trim whitespace before saving a node title.

    true
    
  • Optionalvalidity?: boolean

    Permanently apply node title input validations (CSS and tooltip) on keydown.

    true