Skip to main content

EntityMetaDartProxy

Defined in: js-api/ui.ts:1901

Override the corresponding methods, and register an instance to let Datagrok know how to handle objects of the specified type.

isApplicable is used to associate an object with the handler. When handling an object x, the platform uses the first registered handler that claims that it is applicable to that object.

TODO: search, destructuring to properties

Example: https://public.datagrok.ai/js/samples/ui/handlers/handlers

Extends​

Constructors​

Constructor​

new EntityMetaDartProxy(d): EntityMetaDartProxy

Defined in: js-api/ui.ts:1903

Parameters​

ParameterType
dany

Returns​

EntityMetaDartProxy

Overrides​

ObjectHandler.constructor

Properties​

PropertyTypeInherited fromDefined in
dartanyObjectHandler.dartjs-api/ui.ts:1681

Accessors​

helpUrl​

Get Signature​

get helpUrl(): string | null

Defined in: js-api/ui.ts:1688

URL of help page for the object that this meta handles.

Returns​

string | null

Inherited from​

ObjectHandler.helpUrl


markupRegexp​

Get Signature​

get markupRegexp(): string | null

Defined in: js-api/ui.ts:1831

Creates a regexp for detecting markup descriptions of an object

Returns​

string | null

Inherited from​

ObjectHandler.markupRegexp


name​

Get Signature​

get name(): string

Defined in: js-api/ui.ts:1692

Returns​

string

Inherited from​

ObjectHandler.name


regexpExample​

Get Signature​

get regexpExample(): { example: string; nonVariablePart: string; regexpMarkup: string; } | null

Defined in: js-api/ui.ts:1701

Will be used by search providers to get suggestions (like chembl which has regexp matcher) For something like CHEMBL object handler, it should return: regexpMarkup: 'CHEMBL[0-9]+', example: 'CHEMBL1234', nonVariablePart: 'CHEMBL'

Returns​

{ example: string; nonVariablePart: string; regexpMarkup: string; } | null

Inherited from​

ObjectHandler.regexpExample


type​

Get Signature​

get type(): string

Defined in: js-api/ui.ts:1908

Type of the object that this meta handles.

Returns​

string

Overrides​

ObjectHandler.type

Methods​

fromMarkup()​

fromMarkup(matches): any

Defined in: js-api/ui.ts:1826

Extract object from parsed markup description

Parameters​

ParameterType
matchesstring[]

Returns​

any

Inherited from​

ObjectHandler.fromMarkup


getById()​

getById(id): Promise<any>

Defined in: js-api/ui.ts:1913

Loads the object by id through the Dart meta (null when it does not exist or the meta cannot address it).

Parameters​

ParameterType
idstring

Returns​

Promise<any>

Overrides​

ObjectHandler.getById


getCanvasRenderer()​

getCanvasRenderer(): CanvasRenderer | null

Defined in: js-api/ui.ts:1726

Returns​

CanvasRenderer | null

Inherited from​

ObjectHandler.getCanvasRenderer


getCaption()​

getCaption(x): string

Defined in: js-api/ui.ts:1910

String representation of the [item]: the value of a semantic value or a grid cell, item.toString() otherwise.

Parameters​

ParameterTypeDescription
xanyitem

Returns​

string

Overrides​

ObjectHandler.getCaption


getGridCellRenderer()​

getGridCellRenderer(): GridCellRenderer<any> | null

Defined in: js-api/ui.ts:1731

Returns​

GridCellRenderer<any> | null

Inherited from​

ObjectHandler.getGridCellRenderer


init()​

init(): void

Defined in: js-api/ui.ts:1836

Gets called once upon the registration of meta export class.

Returns​

void

Inherited from​

ObjectHandler.init


isApplicable()​

isApplicable(x): boolean

Defined in: js-api/ui.ts:1909

Override this method to check whether this meta class should handle the specified object.

Parameters​

ParameterTypeDescription
xanyspecified object.

Returns​

boolean

Overrides​

ObjectHandler.isApplicable


refresh()​

refresh(x): Promise<any>

Defined in: js-api/ui.ts:1709

Parameters​

ParameterType
xany

Returns​

Promise<any>

Inherited from​

ObjectHandler.refresh


registerParamFunc()​

registerParamFunc(name, run): void

Defined in: js-api/ui.ts:1889

Registers a function that takes applicable objects as the only argument. It will be suggested to run in the context menu for that object, and also in the "Actions" pane on the context panel.

Example: https://public.datagrok.ai/js/samples/ui/docking/docking

Parameters​

ParameterTypeDescription
namestringfunction name
run(param) => anya function that takes exactly one parameter

Returns​

void

Inherited from​

ObjectHandler.registerParamFunc


renderCard()​

renderCard(x, context?): HTMLDivElement

Defined in: js-api/ui.ts:1918

Renders card div for the item.

Parameters​

ParameterTypeDefault value
xanyundefined
contextanynull

Returns​

HTMLDivElement

Overrides​

ObjectHandler.renderCard


renderGrid()​

renderGrid(grid, options?): void

Defined in: js-api/ui.ts:1923

Customizes a Grid presenting a collection of this handler's objects IN PLACE: column order/visibility, captions, cell renderers, interactivity. options.items is the DataFrame backing the grid when the caller wants the handler to tag or (re)bind it; when omitted, operate on grid.dataFrame.

Contract: derive presentation from column tags/semTypes only — the frame may be a pure data frame (e.g. a queryDf result) with NO hidden ~item object column; never assume one. Interactivity that needs the object goes through the semType renderer/context machinery.

Dispatch: OVERRIDING this member takes FULL responsibility for grid decoration of the built-in views (e.g. the Domain View grid). Any handler that does not override it — including one written against this version of the API — falls through to the platform meta for type, from EITHER side: the Dart dispatch skips the sentinel-marked base (see below), and the base itself delegates, so ObjectHandler.forEntity(x).renderGrid(grid) decorates exactly like the platform. To opt out of decoration entirely, override it with an empty body.

Parameters​

ParameterType
gridGrid
options?{ items?: DataFrame; }
options.items?DataFrame

Returns​

void

Overrides​

ObjectHandler.renderGrid


renderIcon()​

renderIcon(x, context?): HTMLDivElement

Defined in: js-api/ui.ts:1915

Renders icon for the item.

Parameters​

ParameterTypeDefault value
xanyundefined
contextanynull

Returns​

HTMLDivElement

Overrides​

ObjectHandler.renderIcon


renderInput()​

renderInput(x, context?): InputBase<any> | null

Defined in: js-api/ui.ts:1920

Renders an input for the item (e.g. to be used in forms); null when the handler does not define one.

Parameters​

ParameterTypeDefault value
xanyundefined
contextanynull

Returns​

InputBase<any> | null

Overrides​

ObjectHandler.renderInput


renderListItem()​

renderListItem(x, context?): HTMLDivElement

Defined in: js-api/ui.ts:1919

Renders the item as a list item — used when displaying objects in lists (such as wide html grids, or popups in type-ahead boxes). By default, renders the item's name.

Parameters​

ParameterTypeDefault value
xanyundefined
contextanynull

Returns​

HTMLDivElement

Overrides​

ObjectHandler.renderListItem


renderMarkup()​

renderMarkup(x, context?): HTMLDivElement

Defined in: js-api/ui.ts:1916

Renders markup for the item. [context] says what the item is being rendered FOR, so one handler can serve several surfaces. The platform's many-to-many chips pass {relation, table, input: 'tags'} — the relation's name, the OWNER's '<schema>.<table>', and the widget kind. A chip's DG.DomainRow is a {id, displayName} stub with no column values, so read its name through getCaption(x) / x.displayName — x.values[nameColumn] is undefined there.

Parameters​

ParameterTypeDefault value
xanyundefined
contextanynull

Returns​

HTMLDivElement

Overrides​

ObjectHandler.renderMarkup


renderPreview()​

renderPreview(x, params?, path?): Promise<View>

Defined in: js-api/ui.ts:1779

Renders preview list for the item.

Parameters​

ParameterType
xany
params?any
path?string

Returns​

Promise<View>

Inherited from​

ObjectHandler.renderPreview


renderProperties()​

renderProperties(x, context?): HTMLDivElement

Defined in: js-api/ui.ts:1921

Renders properties list for the item.

Parameters​

ParameterTypeDefault value
xanyundefined
contextanynull

Returns​

HTMLDivElement

Overrides​

ObjectHandler.renderProperties


renderTooltip()​

renderTooltip(x, context?): HTMLDivElement

Defined in: js-api/ui.ts:1917

Renders tooltip for the item.

Parameters​

ParameterTypeDefault value
xanyundefined
contextanynull

Returns​

HTMLDivElement

Overrides​

ObjectHandler.renderTooltip


renderView()​

renderView(x, context?): HTMLDivElement

Defined in: js-api/ui.ts:1922

Renders view for the item.

Parameters​

ParameterTypeDefault value
xanyundefined
contextanynull

Returns​

HTMLDivElement

Overrides​

ObjectHandler.renderView


toMarkup()​

toMarkup(T): string | null

Defined in: js-api/ui.ts:1821

Converts object to its markup description

Parameters​

ParameterType
Tany

Returns​

string | null

Inherited from​

ObjectHandler.toMarkup


toString()​

toString(): string

Defined in: js-api/ui.ts:1694

Returns​

string

Inherited from​

ObjectHandler.toString


forEntity()​

static forEntity(object, context?): ObjectHandler<any> | null

Defined in: js-api/ui.ts:1859

Parameters​

ParameterTypeDefault value
objectanyundefined
contextanynull

Returns​

ObjectHandler<any> | null

Inherited from​

ObjectHandler.forEntity


forSemType()​

static forSemType(semType): Promise<ObjectHandler<any>[]>

Defined in: js-api/ui.ts:1876

Parameters​

ParameterType
semTypestring

Returns​

Promise<ObjectHandler<any>[]>

Inherited from​

ObjectHandler.forSemType


list()​

static list(): ObjectHandler<any>[]

Defined in: js-api/ui.ts:1851

All registered handlers

Returns​

ObjectHandler<any>[]

Inherited from​

ObjectHandler.list


onResolve()​

static onResolve(observer): Subscription

Defined in: js-api/ui.ts:1855

Parameters​

ParameterType
observerPartialObserver<ObjectHandlerResolutionArgs>

Returns​

Subscription

Inherited from​

ObjectHandler.onResolve


register()​

static register(meta): void

Defined in: js-api/ui.ts:1839

Registers entity handler.

Parameters​

ParameterType
metaObjectHandler

Returns​

void

Inherited from​

ObjectHandler.register


runDefaultAction()​

static runDefaultAction(x): void

Defined in: js-api/ui.ts:1872

Runs what a double-click on x does in the platform (Browse, cards, lists): opens a project, a table, a script and so on; nothing when the platform has no default action for it.

Parameters​

ParameterType
xany

Returns​

void

Inherited from​

ObjectHandler.runDefaultAction