kor TürkçeGitHub

LookupField

Selects a record through suggestions or an F4 lookup dialog.

kor/ui/LookupFieldSource

When to use

  • Look up a related record by its code or descriptive name.

Examples

Lookup by code or name

Loading the example

<k:LookupField label="Warehouse" rows="{/sites}" keyPath="id" textPath="name" change=".onChange"/>

Assign multiple warehouses

Open the search dialog and narrow the results by area.

Loading the example

<k:LookupField label="Assigned warehouses" rows="{/sites}" keyPath="id" textPath="name" infoPath="region" multiple="true" change=".onChange">
	<k:columns>
		<k:Column label="Code" path="id" width="100"/>
		<k:Column label="Warehouse" path="name" grow="1"/>
		<k:Column label="Area" path="region" grow="1"/>
	</k:columns>
	<k:filterFields><k:FilterField label="Area" path="region"/></k:filterFields>
</k:LookupField>

Keyboard

F4
Open the lookup dialog from the field.

API

Properties

NameTypeDefaultDescription
valuestringKey of the selected record in single-selection mode
textstringDisplay text of the selected record in single-selection mode
selectionobjectnullArray of selected records as {key, text} in multiple-selection mode
multiplebooleanfalseWhether multiple records can be chosen
keyPathstringidPath to a record's key
textPathstringnamePath to a record's display text
infoPathstringPath to secondary text in suggestions
labelstringField label and dialog title
placeholderstringPlaceholder
helpstringSupporting text
errorstringValidation message
requiredbooleanfalseWhether selection is required
enabledbooleantrueWhether the field can be used

Aggregations

NameTypeDescription
columnsColumn[]Dialog columns. Defaults to key and text
filterFieldsFilterField[]Available dialog filters
rowssap.ui.core.Element[]Records supplied by a list binding without a template

Events

NameTypeDescription
changevalue: string
text: string
context: object
selection: object
The selection changed

Methods

NameDescription
getSelectedKeys(): string[]Returns selected keys in multiple-selection mode for form validation
type LookupEntry = { key: string; text: string };

Column

A column in a DataGrid or TreeGrid.

Properties

NameTypeDefaultDescription
labelstringHeader
pathstringField path relative to the row context
typestringtexttext, link, number, currency, date, status, progress, person or spark
widthfloat140Width in pixels
growfloat0Share of the available extra width
decimalsint0Number of decimal places
unitPathstringPath to the unit or currency field
statePathstringPath to a status field with success, wait, danger, info or none
statesobjectMapping from cell values to statuses
optionsobjectChoices offered when editing
editablebooleanfalseWhether cells can be edited
sortablebooleantrueWhether the column can be sorted
pinnedbooleanfalseWhether this leading column stays in place during horizontal scrolling
formatterfunctionFunction that formats a value and row context as text

FilterField

A field available in a FilterBar.

Properties

NameTypeDefaultDescription
labelstringField label
pathstringModel path
typestringtexttext, number or option
optionsobjectAvailable choices
unitstringUnit displayed with a numeric value

Related

SelectFieldMultiSelectDataGrid