@serenity-is/corelib / ComboboxEditor
Class: ComboboxEditor<P, TItem>
Defined in: src/ui/editors/comboboxeditor.tsx:145
Base editor that renders a searchable combobox over a set of items.
Extends
EditorWidget<P>
Extended by
EnumEditorLookupEditorBaseSelectEditorServiceLookupEditorBaseFilterFieldSelectFilterOperatorSelect
Type Parameters
P
P
Widget props type.
TItem
TItem
The item type.
Implements
Constructors
Constructor
new ComboboxEditor<
P,TItem>(props):ComboboxEditor<P,TItem>
Defined in: src/ui/editors/comboboxeditor.tsx:165
Creates a combobox editor.
Parameters
props
EditorProps<P>
Widget props.
Returns
ComboboxEditor<P, TItem>
Overrides
Properties
cascadeLink
protectedcascadeLink:CascadedWidgetLink<Widget<any>>
Defined in: src/ui/editors/comboboxeditor.tsx:1131
domNode
readonlydomNode:HTMLInputElement
Defined in: src/ui/editors/comboboxeditor.tsx:153
The hidden input element that backs the combobox editor.
Overrides
idPrefix
readonlyidPrefix:string
Defined in: src/ui/widgets/widget.ts:22
The id prefix used for this widget's child element ids.
Inherited from
lastCreateTerm
protectedlastCreateTerm:string
Defined in: src/ui/editors/comboboxeditor.tsx:159
onInitNewEntity()
onInitNewEntity: (
entity) =>void
Defined in: src/ui/editors/comboboxeditor.tsx:1423
Callback invoked to initialize a new entity for in-place add.
Parameters
entity
TItem
Returns
void
openDialogAsPanel
openDialogAsPanel:
boolean
Defined in: src/ui/editors/comboboxeditor.tsx:1558
Whether the in-place add dialog opens as a panel.
options
protectedreadonlyoptions:WidgetProps<EditorProps<P>>
Defined in: src/ui/widgets/widget.ts:18
The widget's options/props.
Inherited from
uniqueName
readonlyuniqueName:string
Defined in: src/ui/widgets/widget.ts:20
A unique name for this widget instance, used for event namespacing.
Inherited from
[typeInfo]
static[typeInfo]:ClassTypeInfo<"Serenity.">
Defined in: src/ui/editors/comboboxeditor.tsx:147
Implementation of
Overrides
defaults
readonlystaticdefaults:ComboboxEditorDefaults
Defined in: src/ui/editors/comboboxeditor.tsx:408
The defaults of the combobox editors, see ComboboxEditorDefaults.
isComponent
readonlystaticisComponent:true=true
Defined in: src/ui/widgets/widget.ts:334
Inherited from
Accessors
cascadeField
Get Signature
get cascadeField():
string
Defined in: src/ui/editors/comboboxeditor.tsx:1201
Returns the cascade field name.
Returns
string
The cascade field.
Set Signature
set cascadeField(
value):void
Defined in: src/ui/editors/comboboxeditor.tsx:1215
Sets the cascade field name.
Parameters
value
string
The field name used for cascading.
Returns
void
cascadeFrom
Get Signature
get cascadeFrom():
string
Defined in: src/ui/editors/comboboxeditor.tsx:1168
Returns the cascade-from parent id.
Returns
string
The parent id.
Set Signature
set cascadeFrom(
value):void
Defined in: src/ui/editors/comboboxeditor.tsx:1185
Sets the cascade-from parent id.
Parameters
value
string
The parent editor id to cascade from.
Returns
void
cascadeValue
Get Signature
get cascadeValue():
any
Defined in: src/ui/editors/comboboxeditor.tsx:1231
Returns the cascade value.
Returns
any
The cascade value.
Set Signature
set cascadeValue(
value):void
Defined in: src/ui/editors/comboboxeditor.tsx:1249
Sets the cascade value.
Parameters
value
any
The cascade value to filter by.
Returns
void
comboboxOptions
Get Signature
get
protectedcomboboxOptions():ComboboxCommonOptions
Defined in: src/ui/editors/comboboxeditor.tsx:522
The options of the editor that the comboboxes share, see ComboboxCommonOptions.
Returns
element
Get Signature
get element():
Fluent
Defined in: src/ui/widgets/widget.ts:82
Returns a Fluent(this.domNode) object
Returns
Inherited from
filterField
Get Signature
get filterField():
string
Defined in: src/ui/editors/comboboxeditor.tsx:1278
Returns the filter field name.
Returns
string
The filter field.
Set Signature
set filterField(
value):void
Defined in: src/ui/editors/comboboxeditor.tsx:1292
Sets the filter field name.
Parameters
value
string
The field name used for filtering.
Returns
void
filterValue
Get Signature
get filterValue():
any
Defined in: src/ui/editors/comboboxeditor.tsx:1308
Returns the filter value.
Returns
any
The filter value.
Set Signature
set filterValue(
value):void
Defined in: src/ui/editors/comboboxeditor.tsx:1326
Sets the filter value.
Parameters
value
any
The filter value to apply.
Returns
void
itemById
Get Signature
get
protecteditemById():object
Defined in: src/ui/editors/comboboxeditor.tsx:667
Returns
object
Set Signature
set
protecteditemById(value):void
Defined in: src/ui/editors/comboboxeditor.tsx:674
Parameters
value
Returns
void
itemFilter
Get Signature
get itemFilter(): (
item) =>boolean
Defined in: src/ui/editors/comboboxeditor.tsx:1262
A filter of the items that the editor offers, e.g. the ones that suit the value of another field. It doesn't change the items, so the selected one is still shown when it doesn't pass. It applies to the editors whose items are in place, e.g. a select editor, not to the ones that search them on the server.
Returns
(
item):boolean
Parameters
item
ComboboxItem<TItem>
Returns
boolean
Set Signature
set itemFilter(
value):void
Defined in: src/ui/editors/comboboxeditor.tsx:1266
Parameters
value
(item) => boolean
Returns
void
items
Get Signature
get items():
ComboboxItem<TItem>[]
Defined in: src/ui/editors/comboboxeditor.tsx:648
Returns the items in the editor.
Returns
ComboboxItem<TItem>[]
The items.
Set Signature
set items(
value):void
Defined in: src/ui/editors/comboboxeditor.tsx:657
Sets the items in the editor.
Parameters
value
ComboboxItem<TItem>[]
The combobox items to set.
Returns
void
props
Get Signature
get props():
WidgetProps<P>
Defined in: src/ui/widgets/widget.ts:307
Returns the widget's props/options.
Returns
WidgetProps<P>
Inherited from
readOnly
Get Signature
get readOnly():
boolean
Defined in: src/ui/editors/editorwidget.ts:42
Returns whether the editor is read-only.
Returns
boolean
True when read-only.
Set Signature
set readOnly(
value):void
Defined in: src/ui/editors/editorwidget.ts:48
Sets whether the editor is read-only.
Parameters
value
boolean
Returns
void
Inherited from
selectedItem
Get Signature
get selectedItem():
TItem
Defined in: src/ui/editors/comboboxeditor.tsx:1014
Returns the currently selected item.
Returns
TItem
The selected item, or null.
selectedItems
Get Signature
get selectedItems():
TItem[]
Defined in: src/ui/editors/comboboxeditor.tsx:1028
Returns the currently selected items.
Returns
TItem[]
The selected items.
selectionLoadState
Get Signature
get selectionLoadState():
"error"|"loading"|"idle"
Defined in: src/ui/editors/comboboxeditor.tsx:231
Returns the current state of the initial selection load. "idle" means there is no pending or failed load. It does not guarantee that an item is currently selected.
Returns
"error" | "loading" | "idle"
text
Get Signature
get text():
string
Defined in: src/ui/editors/comboboxeditor.tsx:1088
Returns the display text of the current selection.
Returns
string
The comma-joined display text of the selected item(s).
value
Get Signature
get value():
string
Defined in: src/ui/editors/comboboxeditor.tsx:985
Returns the current value.
Returns
string
The value.
Set Signature
set value(
v):void
Defined in: src/ui/editors/comboboxeditor.tsx:1006
Sets the current value.
Parameters
v
string
The single value to set.
Returns
void
values
Get Signature
get values():
string[]
Defined in: src/ui/editors/comboboxeditor.tsx:1055
Returns the current values.
Returns
string[]
The values.
Set Signature
set values(
value):void
Defined in: src/ui/editors/comboboxeditor.tsx:1069
Sets the current values.
Parameters
value
string[]
The array of selected values to set.
Returns
void
Methods
abortPendingQuery()
protectedabortPendingQuery():void
Defined in: src/ui/editors/comboboxeditor.tsx:403
Aborts any pending search query.
Returns
void
addCssClass()
protectedaddCssClass():void
Defined in: src/ui/widgets/widget.ts:89
Adds the widget's CSS class to its DOM node.
Returns
void
Inherited from
addInplaceCreate()
protectedaddInplaceCreate(addTitle,editTitle):void
Defined in: src/ui/editors/comboboxeditor.tsx:770
Adds the in-place create button.
Parameters
addTitle
string
Title for the add button.
editTitle
string
Title for the edit button.
Returns
void
addItem()
addItem(
item):void
Defined in: src/ui/editors/comboboxeditor.tsx:696
Adds an item to the editor.
Parameters
item
ComboboxItem<TItem>
The item to add.
Returns
void
addOption()
addOption(
key,text,source?,disabled?):void
Defined in: src/ui/editors/comboboxeditor.tsx:711
Adds an option to the editor.
Parameters
key
string
The option id.
text
string
The display text.
source?
any
Optional source item.
disabled?
boolean
Whether the option is disabled.
Returns
void
addValidationRule()
Call Signature
addValidationRule(
rule,uniqueName?):void
Defined in: src/ui/widgets/widget.ts:142
Adds a validation rule to the widget's DOM node.
Parameters
rule
(input) => string
The validation rule function, or a unique name when the two-argument overload is used.
uniqueName?
string
A unique name for the rule, or the rule function when the two-argument overload is used.
Returns
void
Inherited from
EditorWidget.addValidationRule
Call Signature
addValidationRule(
uniqueName,rule):void
Defined in: src/ui/widgets/widget.ts:143
Adds a validation rule to the widget's DOM node.
Parameters
uniqueName
string
A unique name for the rule, or the rule function when the two-argument overload is used.
rule
(input) => string
The validation rule function, or a unique name when the two-argument overload is used.
Returns
void
Inherited from
EditorWidget.addValidationRule
afterRender()
protectedafterRender(callback):void
Defined in: src/ui/widgets/widget.ts:228
Queues a callback to run after the widget's contents are rendered.
Parameters
callback
() => void
The callback to run after rendering.
Returns
void
Inherited from
allowClear()
protectedallowClear():boolean
Defined in: src/ui/editors/comboboxeditor.tsx:384
Whether the selection can be cleared.
Returns
boolean
True when clear is allowed.
applyCheckList()
protectedapplyCheckList(opt):void
Defined in: src/ui/editors/comboboxeditor.tsx:536
Gives a checklist its options: the check boxes and the item that selects all the results of the list, and the summary that takes the place of the choice of each selected item.
Parameters
opt
The options to change.
Returns
void
asyncSearch()
protectedasyncSearch(query):PromiseLike<ComboboxSearchResult<TItem>>
Defined in: src/ui/editors/comboboxeditor.tsx:219
Performs an asynchronous search.
Parameters
query
The search query.
Returns
PromiseLike<ComboboxSearchResult<TItem>>
A promise resolving to the search result.
byId()
protectedbyId<TElement>(id):Fluent<TElement>
Defined in: src/ui/widgets/widget.ts:154
Finds a child element by its prefix-relative id.
Type Parameters
TElement
TElement extends HTMLElement = HTMLElement
Parameters
id
string
The id relative to the widget's id prefix.
Returns
Fluent<TElement>
A Fluent wrapper for the matching element.
Inherited from
cascadeItems()
protectedcascadeItems(items):TItem[]
Defined in: src/ui/editors/comboboxeditor.tsx:1335
Filters items by the cascade value.
Parameters
items
TItem[]
The items to filter.
Returns
TItem[]
The filtered items.
change()
change(
handler):void
Defined in: src/ui/widgets/widget.ts:179
Registers a change handler on the widget's DOM node.
Parameters
handler
(e) => void
The change event handler.
Returns
void
Inherited from
changeSelect2()
changeSelect2(
handler):void
Defined in: src/ui/widgets/widget.ts:188
Registers a change handler that ignores changes originating from
combobox setting values.
Parameters
handler
(e) => void
The change event handler.
Returns
void
Inherited from
clearItems()
clearItems():
void
Defined in: src/ui/editors/comboboxeditor.tsx:684
Clears all items from the editor.
Returns
void
createEditDialog()
protectedcreateEditDialog(callback):void
Defined in: src/ui/editors/comboboxeditor.tsx:1413
Creates an edit dialog for in-place add.
Parameters
callback
(dlg) => void
Callback invoked with the created dialog.
Returns
void
deferRender()
protecteddeferRender():boolean
Defined in: src/ui/widgets/widget.ts:98
Determines whether rendering should be deferred until init is called.
Returns
boolean
True to defer rendering.
Inherited from
destroy()
destroy():
void
Defined in: src/ui/editors/comboboxeditor.tsx:196
Disposes the combobox, unbinds the cascade link and delegates to the base destroy.
Returns
void
Overrides
editDialogDataChange()
protectededitDialogDataChange():void
Defined in: src/ui/editors/comboboxeditor.tsx:1459
Hook invoked when the edit dialog data changes.
Returns
void
emptyItemText()
protectedemptyItemText():string
Defined in: src/ui/editors/comboboxeditor.tsx:275
Returns the text for the empty item.
Returns
string
The empty item text.
ensureSelectionLoaded()
ensureSelectionLoaded():
Promise<void>
Defined in: src/ui/editors/comboboxeditor.tsx:241
Waits for the current initial selection load, if necessary.
Returns
Promise<void>
A promise that resolves when the selection is loaded or rejects if loading fails or is aborted. It resolves immediately when there is no pending load.
filterItems()
protectedfilterItems(items):TItem[]
Defined in: src/ui/editors/comboboxeditor.tsx:1362
Filters items by the filter value.
Parameters
items
TItem[]
The items to filter.
Returns
TItem[]
The filtered items.
findById()
protectedfindById<TElement>(id):TElement
Defined in: src/ui/widgets/widget.ts:163
Finds a child element by its prefix-relative id.
Type Parameters
TElement
TElement extends HTMLElement = HTMLElement
Parameters
id
string
The id relative to the widget's id prefix.
Returns
TElement
The matching element, or null if not found.
Inherited from
formatCheckListContent()
protectedformatCheckListContent(item,query):string|Element|DocumentFragment|SVGElement
Defined in: src/ui/editors/comboboxeditor.tsx:578
Renders the icon of an item, when it has one, and its text, which the matching part of the search is marked in.
Parameters
item
query
Returns
string | Element | DocumentFragment | SVGElement
formatCheckListResult()
protectedformatCheckListResult(item,container,query):JSXElement
Defined in: src/ui/editors/comboboxeditor.tsx:562
Renders a result of a checklist, with a check box before it, which the styles mark when it is selected.
Parameters
item
container
HTMLElement
query
Returns
formatSelectAll()
protectedformatSelectAll(item,container,query):JSXElement
Defined in: src/ui/editors/comboboxeditor.tsx:572
Renders the item that selects all the results of a checklist, or clears them, with a check box, and a text that the select keeps up to date.
Parameters
item
container
HTMLElement
query
Returns
get_cascadeField()
protectedget_cascadeField():string
Defined in: src/ui/editors/comboboxeditor.tsx:1193
Returns the cascade field name.
Returns
string
The cascade field.
get_cascadeFrom()
protectedget_cascadeFrom():string
Defined in: src/ui/editors/comboboxeditor.tsx:1160
Returns the cascade-from parent id.
Returns
string
The parent id.
get_cascadeValue()
protectedget_cascadeValue():any
Defined in: src/ui/editors/comboboxeditor.tsx:1223
Returns the cascade value.
Returns
any
The cascade value.
get_delimited()
get_delimited():
boolean
Defined in: src/ui/editors/comboboxeditor.tsx:640
Returns whether the value is delimited.
Returns
boolean
True when delimited.
get_filterField()
protectedget_filterField():string
Defined in: src/ui/editors/comboboxeditor.tsx:1270
Returns
string
get_filterValue()
protectedget_filterValue():any
Defined in: src/ui/editors/comboboxeditor.tsx:1300
Returns the filter value.
Returns
any
The filter value.
get_itemByKey()
protectedget_itemByKey():object
Defined in: src/ui/editors/comboboxeditor.tsx:940
Returns the item-by-id map.
Returns
object
The item map.
get_items()
protectedget_items():ComboboxItem<TItem>[]
Defined in: src/ui/editors/comboboxeditor.tsx:932
Returns the items in the editor.
Returns
ComboboxItem<TItem>[]
The items.
get_readOnly()
get_readOnly():
boolean
Defined in: src/ui/editors/comboboxeditor.tsx:1096
Returns whether the editor is read-only.
Returns
boolean
True when read-only.
Implementation of
get_text()
protectedget_text():string
Defined in: src/ui/editors/comboboxeditor.tsx:1077
Returns the display text of the current selection.
Returns
string
The text.
get_value()
get_value():
string
Defined in: src/ui/editors/comboboxeditor.tsx:977
Returns the current value.
Returns
string
The value.
Implementation of
get_values()
protectedget_values():string[]
Defined in: src/ui/editors/comboboxeditor.tsx:1047
Returns the current values.
Returns
string[]
The values.
getCascadeFromValue()
protectedgetCascadeFromValue(parent):any
Defined in: src/ui/editors/comboboxeditor.tsx:1127
Returns the cascade value from a parent widget.
Parameters
parent
Widget<any>
The parent widget.
Returns
any
The cascade value.
getComboboxContainer()
protectedgetComboboxContainer():HTMLElement
Defined in: src/ui/editors/comboboxeditor.tsx:924
Returns the combobox container element.
Returns
HTMLElement
The container element.
getComboboxOptions()
protectedgetComboboxOptions():ComboboxOptions
Defined in: src/ui/editors/comboboxeditor.tsx:417
Returns the combobox options for this editor.
Returns
Combobox options.
getCreateSearchChoice()
getCreateSearchChoice(
getName): (s) =>object
Defined in: src/ui/editors/comboboxeditor.tsx:845
Returns a callback that creates a search choice for a term.
Parameters
getName
(z) => string
Optional callback to get the name of an item.
Returns
The search choice callback.
(
s):object
Parameters
s
string
Returns
object
id
id:
string
text
text:
string
getCssClass()
protectedgetCssClass():string
Defined in: src/ui/widgets/widget.ts:106
Returns the CSS class(es) applied to the widget's DOM node.
Returns
string
The space-separated CSS class string.
Inherited from
getCssClassField()
protectedgetCssClassField():string
Defined in: src/ui/editors/comboboxeditor.tsx:733
Returns the field of an item that holds its CSS class, see ComboboxCommonOptions.cssClassField, which a lookup can also tell in its script.
Returns
string
getCustomAttribute()
protectedgetCustomAttribute<TAttr>(attrType,inherit):TAttr
Defined in: src/ui/widgets/widget.ts:220
Returns a custom attribute applied to the widget's type.
Type Parameters
TAttr
TAttr extends CustomAttribute
Parameters
attrType
(...args) => TAttr
The attribute type to look up.
inherit
boolean = true
Whether to search inherited types; defaults to true.
Returns
TAttr
The matching attribute, or null.
Inherited from
EditorWidget.getCustomAttribute
getDialogType()
protectedgetDialogType():DialogType|PromiseLike<DialogType>
Defined in: src/ui/editors/comboboxeditor.tsx:1388
Returns the dialog type used for in-place add.
Returns
DialogType | PromiseLike<DialogType>
The dialog type.
getDialogTypeKey()
protectedgetDialogTypeKey():string
Defined in: src/ui/editors/comboboxeditor.tsx:1401
[DEPRECATED] Override getDialogType() instead
Returns
string
getEditValue()
getEditValue(
property,target):void
Defined in: src/ui/editors/comboboxeditor.tsx:911
Gets the edit value into a target object.
Parameters
property
The property item.
target
any
The target object.
Returns
void
Implementation of
getGridField()
getGridField():
Fluent
Defined in: src/ui/widgets/widget.ts:171
Returns the closest .field element containing the widget's DOM node.
Returns
A Fluent wrapper for the grid field.
Inherited from
getIconField()
protectedgetIconField():any
Defined in: src/ui/editors/comboboxeditor.tsx:340
Gets the name of the icon field.
Returns
any
The name of the icon field.
getIdField()
protectedgetIdField():any
Defined in: src/ui/editors/comboboxeditor.tsx:292
Returns the id field name.
Returns
any
The id field.
getPageSize()
protectedgetPageSize():number
Defined in: src/ui/editors/comboboxeditor.tsx:284
Returns the page size for paged searches.
Returns
number
The page size.
getSelectedItemAsync()
getSelectedItemAsync():
Promise<TItem>
Defined in: src/ui/editors/comboboxeditor.tsx:249
Waits for the current initial selection load and returns the selected item.
Returns
Promise<TItem>
The selected item, or null when nothing is selected.
getSelectedItemsAsync()
getSelectedItemsAsync():
Promise<TItem[]>
Defined in: src/ui/editors/comboboxeditor.tsx:258
Waits for the current initial selection load and returns the selected items.
Returns
Promise<TItem[]>
The selected items.
getTextField()
protectedgetTextField():any
Defined in: src/ui/editors/comboboxeditor.tsx:312
Returns the text field name.
Returns
any
The text field.
getTextKeyField()
protectedgetTextKeyField():string
Defined in: src/ui/editors/comboboxeditor.tsx:725
Returns the field of an item that holds its local text key, see ComboboxCommonOptions.textKeyField, which a lookup can also tell in its script, e.g. one of a table that keeps its texts as keys.
Returns
string
getTypeDelay()
protectedgetTypeDelay():any
Defined in: src/ui/editors/comboboxeditor.tsx:267
Returns the type delay for searching.
Returns
any
The delay in milliseconds.
hasAsyncSource()
protectedhasAsyncSource():boolean
Defined in: src/ui/editors/comboboxeditor.tsx:210
Whether the editor has an asynchronous item source.
Returns
boolean
True when async.
init()
init():
this
Defined in: src/ui/widgets/widget.ts:243
Initializes the widget, rendering its contents if rendering was deferred.
Returns
this
This widget instance.
Inherited from
initNewEntity()
protectedinitNewEntity(entity):void
Defined in: src/ui/editors/comboboxeditor.tsx:1429
Initializes a new entity with cascade/filter values.
Parameters
entity
TItem
The new entity.
Returns
void
inplaceCreateClick()
protectedinplaceCreateClick(e):void
Defined in: src/ui/editors/comboboxeditor.tsx:1481
Handles the in-place create button click.
Parameters
e
Event
The click event.
Returns
void
internalRenderContents()
internalRenderContents():
void
Defined in: src/ui/widgets/widget.ts:266
Renders the widget's contents and runs any queued after-render callbacks.
Returns
void
Inherited from
EditorWidget.internalRenderContents
isAutoComplete()
protectedisAutoComplete():boolean
Defined in: src/ui/editors/comboboxeditor.tsx:836
Whether arbitrary values are allowed.
Returns
boolean
True when auto-complete is enabled.
isMultiple()
protectedisMultiple():boolean
Defined in: src/ui/editors/comboboxeditor.tsx:393
Whether multiple items can be selected.
Returns
boolean
True when multiple.
itemCssClass()
protecteditemCssClass(item):string
Defined in: src/ui/editors/comboboxeditor.tsx:741
Returns the CSS class of an item, from the field that the editor or its source gives, see ComboboxCommonOptions.cssClassField.
Parameters
item
any
Returns
string
itemDisabled()
protecteditemDisabled(item):boolean
Defined in: src/ui/editors/comboboxeditor.tsx:332
Whether an item is disabled.
Parameters
item
TItem
The item.
Returns
boolean
True when disabled.
itemIcon()
protecteditemIcon(item):IconClassName
Defined in: src/ui/editors/comboboxeditor.tsx:349
Returns the icon of an item.
Parameters
item
TItem
The item.
Returns
The item icon.
itemId()
protecteditemId(item):string
Defined in: src/ui/editors/comboboxeditor.tsx:301
Returns the id of an item.
Parameters
item
TItem
The item.
Returns
string
The item id.
itemText()
protecteditemText(item):string
Defined in: src/ui/editors/comboboxeditor.tsx:321
Returns the display text of an item.
Parameters
item
TItem
The item.
Returns
string
The item text.
legacyTemplateRender()
protectedlegacyTemplateRender():boolean
Defined in: src/ui/widgets/widget.ts:291
Renders the widget from a legacy getTemplate string, if defined.
Returns
boolean
True if a legacy template was rendered.
Inherited from
EditorWidget.legacyTemplateRender
localizeItemText()
protectedlocalizeItemText(text,source?):string
Defined in: src/ui/editors/comboboxeditor.tsx:753
Returns the text of an item, localized when the editor says which field of it holds the local text key, see ComboboxCommonOptions.textKeyField. An item may have no text of its own, only the key, in which case its text is what the key gives, and the key itself when there is no text for it, as a key is readable enough. A null or an empty text is no text, which the styles show as an empty cell, not as a missing one.
Parameters
text
string
source?
any
Returns
string
mapItem()
protectedmapItem(item):ComboboxItem
Defined in: src/ui/editors/comboboxeditor.tsx:360
Maps an item to a combobox item.
Parameters
item
TItem
The item.
Returns
The combobox item.
mapItems()
protectedmapItems(items):ComboboxItem<any>[]
Defined in: src/ui/editors/comboboxeditor.tsx:376
Maps a list of items to combobox items.
Parameters
items
TItem[]
The items.
Returns
ComboboxItem<any>[]
The combobox items.
openDropdown()
openDropdown():
void
Defined in: src/ui/editors/comboboxeditor.tsx:1553
Opens the combobox dropdown.
Returns
void
render()
render():
any
Defined in: src/ui/widgets/widget.ts:253
Returns the main element for this widget or the document fragment. As widgets may get their elements from props unlike regular JSX widgets, this method should not be overridden. Override renderContents() instead.
Returns
any
Inherited from
renderContents()
protectedrenderContents():any
Defined in: src/ui/widgets/widget.ts:281
Renders the widget's contents. Override this to provide custom content.
Returns
any
The rendered contents.
Inherited from
renderSelectionSummary()
protectedrenderSelectionSummary(items,container):void
Defined in: src/ui/editors/comboboxeditor.tsx:588
Renders the selection of a checklist in one element, e.g. "A, B, C +2", with the full list in its tooltip, or the placeholder of the editor, with ComboboxCommonOptions.placeholderIcon, when nothing is selected.
Parameters
items
ComboboxItem<any>[]
container
HTMLElement
Returns
void
set_cascadeField()
protectedset_cascadeField(value):void
Defined in: src/ui/editors/comboboxeditor.tsx:1209
Sets the cascade field name.
Parameters
value
string
The cascade field.
Returns
void
set_cascadeFrom()
protectedset_cascadeFrom(value):void
Defined in: src/ui/editors/comboboxeditor.tsx:1176
Sets the cascade-from parent id.
Parameters
value
string
The parent id.
Returns
void
set_cascadeValue()
protectedset_cascadeValue(value):void
Defined in: src/ui/editors/comboboxeditor.tsx:1239
Sets the cascade value and refreshes items.
Parameters
value
any
The cascade value.
Returns
void
set_filterField()
protectedset_filterField(value):void
Defined in: src/ui/editors/comboboxeditor.tsx:1286
Sets the filter field name.
Parameters
value
string
The filter field.
Returns
void
set_filterValue()
protectedset_filterValue(value):void
Defined in: src/ui/editors/comboboxeditor.tsx:1316
Sets the filter value and refreshes items.
Parameters
value
any
The filter value.
Returns
void
set_readOnly()
set_readOnly(
value):void
Defined in: src/ui/editors/comboboxeditor.tsx:1115
Sets whether the editor is read-only.
Parameters
value
boolean
True to enable read-only mode.
Returns
void
Implementation of
set_value()
set_value(
value):void
Defined in: src/ui/editors/comboboxeditor.tsx:993
Sets the current value.
Parameters
value
string
The value to set.
Returns
void
Implementation of
set_values()
protectedset_values(value):void
Defined in: src/ui/editors/comboboxeditor.tsx:1063
Sets the current values.
Parameters
value
string[]
The values to set.
Returns
void
setCascadeFrom()
protectedsetCascadeFrom(value):void
Defined in: src/ui/editors/comboboxeditor.tsx:1137
Sets the cascade-from parent id.
Parameters
value
string
The parent id.
Returns
void
setEditDialogReadOnly()
protectedsetEditDialogReadOnly(dialog):void
Defined in: src/ui/editors/comboboxeditor.tsx:1447
Sets the edit dialog to read-only.
Parameters
dialog
any
The dialog.
Returns
void
setEditValue()
setEditValue(
source,property):void
Defined in: src/ui/editors/comboboxeditor.tsx:896
Sets the edit value from a source object.
Parameters
source
any
The source object.
property
The property item.
Returns
void
Implementation of
setTermOnNewEntity()
protectedsetTermOnNewEntity(entity,term,dialog):void
Defined in: src/ui/editors/comboboxeditor.tsx:1468
Sets the search term on a new entity.
Parameters
entity
TItem
The new entity.
term
string
The search term.
dialog
any
The edit dialog.
Returns
void
syncOrAsyncThen()
protectedsyncOrAsyncThen<T>(syncMethod,asyncMethod,then):void
Defined in: src/ui/widgets/widget.ts:318
Runs a method synchronously or asynchronously depending on the widget's
useAsync flag, then invokes a continuation.
Type Parameters
T
T
Parameters
syncMethod
() => T
The synchronous method to run.
asyncMethod
() => PromiseLike<T>
The asynchronous method to run.
then
(v) => void
The continuation invoked with the result.
Returns
void
Inherited from
updateItems()
protectedupdateItems():void
Defined in: src/ui/editors/comboboxeditor.tsx:1381
Refreshes the items in the editor.
Returns
void
useCheckList()
protecteduseCheckList():boolean
Defined in: src/ui/editors/comboboxeditor.tsx:527
Whether the editor shows a multiple selection as a checklist, see ComboboxCommonOptions.checkList.
Returns
boolean
useIdPrefix()
protecteduseIdPrefix():IdPrefixType
Defined in: src/ui/widgets/widget.ts:329
Returns an id prefix helper for resolving child element ids.
Returns
An IdPrefixType proxy for this widget's id prefix.
Inherited from
useInplaceAdd()
protecteduseInplaceAdd():boolean
Defined in: src/ui/editors/comboboxeditor.tsx:825
Whether in-place add is enabled.
Returns
boolean
True when enabled.
create()
staticcreate<TWidget,P>(params):TWidget
Defined in: src/ui/widgets/widget.ts:202
Creates a widget instance from the given params, appending its element to the container and invoking the init/init callbacks.
Type Parameters
TWidget
TWidget extends Widget<P>
P
P
Parameters
params
CreateWidgetParams<TWidget, P>
The widget creation params.
Returns
TWidget
The created widget instance.
Inherited from
createDefaultElement()
staticcreateDefaultElement():HTMLInputElement
Defined in: src/ui/editors/comboboxeditor.tsx:151
Creates the default hidden input element for the combobox.
Returns
HTMLInputElement
The hidden input element.
Overrides
EditorWidget.createDefaultElement
filterByText()
staticfilterByText<TItem>(items,getText,term):TItem[]
Defined in: src/ui/editors/comboboxeditor.tsx:951
Filters items by text, matching the term against the item text.
Type Parameters
TItem
TItem
Parameters
items
TItem[]
The items to filter.
getText
(item) => string
Callback that returns the text of an item.
term
string
The search term.
Returns
TItem[]
The filtered items.
getWidgetName()
staticgetWidgetName(type):string
Defined in: src/ui/widgets/widget.ts:131
Returns the widget name for a type, used for association and unique names.
Parameters
type
Function
The widget type.
Returns
string
The widget name.
Inherited from
registerClass()
protectedstaticregisterClass<TypeName>(typeName,intfAndAttr?):ClassTypeInfo<TypeName>
Defined in: src/ui/widgets/widget.ts:342
Registers this type as a class with the given type name.
Type Parameters
TypeName
TypeName
Parameters
typeName
StringLiteral<TypeName>
The type name to register.
intfAndAttr?
(InterfaceType | AttributeSpecifier)[]
Optional interfaces and attributes.
Returns
ClassTypeInfo<TypeName>
The class type info.
Inherited from
registerEditor()
protectedstaticregisterEditor<TypeName>(typeName,intfAndAttr?):EditorTypeInfo<TypeName>
Defined in: src/ui/widgets/widget.ts:357
Registers this type as an editor with the given type name.
Type Parameters
TypeName
TypeName
Parameters
typeName
StringLiteral<TypeName>
The type name to register.
intfAndAttr?
(InterfaceType | AttributeSpecifier)[]
Optional interfaces and attributes.
Returns
EditorTypeInfo<TypeName>
The editor type info.