Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AbstractEditor

This is an optional base class for a custom editor. Inheriting from AbstractEditor will setup most required editor-methods to work by default, while still allowing custom implementations. Most of all, it removes the tedious and redundant editron/serivce/pointer bootstraping.

Still required is

 1. a custom `static editorOf(p, c, o)`-method, to register on a schema
 2. an `update(event)`-method to respond to changes

Convenience methods are

 - `getData()` to fetch the associated data of the current _pointer_
 - `setData(newValue)` to update the associated data of the current _pointer_
 - `getSchema()` returning the json-schema of the current _pointer_
 - `getErrors()` returning a list of current errors
 - `getElement()` gives you the root dom-node for this editor (aka render target)
 - `focus()` and `blur()` to manage the selection state of the current input (requires correct placement of _id_)
param

pointer referencing the current data and schema

param

editron instance

param

resolved options object

Hierarchy

Implements

Index

Constructors

constructor

Properties

dom

dom: HTMLElement

editron

editron: default

options

pointer

pointer: string

Methods

blur

  • blur(): void

destroy

  • destroy(): void

focus

  • focus(): void

getData

  • getData(): any

getElement

  • getElement(): HTMLElement

getErrors

getPointer

  • getPointer(): string

getSchema

setData

  • setData(data: any): void

update

Static editorOf

  • editorOf(pointer: string, editron: default, options?: any): void

Generated using TypeDoc