Appearance
Remote search
Enter keywords and search data from server.
Remote search refers to the process of accessing and searching for information stored on a data base.
The process of remote search generally involves the following steps:
Query: The user submits a query or search request to the remote server, specifying the search criteria and parameters.
Search: The remote server searches its database and returns the results to the user.
Display: The search results are displayed to the user in the select.
Basic Usage
idKey and labelKey are two important properties used in remote search components, to define how search results are displayed and returned to the user.
The idKey property specifies the name of the property in the remote data source that uniquely identifies each item in the search results. This is typically a unique identifier, such as ID. When the user selects an item from the search results, the value of the idKey property is returned as the selected item.
The labelKey property, on the other hand, specifies the name of the property in the remote data source that contains the text or label to be displayed for each item in the search results. This is typically the name or description of the item. When the search results are displayed to the user, the value of the labelKey property is used to render the label or text for each item in the list.
Together, the idKey and labelKey properties allow the remote search component to retrieve and display search results from a remote data source in a way that is both meaningful and efficient for the user.
entityType is a property used in remote search components to specify the type of entity being searched for.
A query filter is a feature commonly used in databases and data retrieval systems to limit the results of a query based on specified conditions.
When querying a database, a filter can be applied to the query to return only those records or rows that meet a particular set of criteria.
js
<RemoteSearch
v-model="value"
entity-type="Post"
label="Post"
placeholder="Select post"
id-key="id"
label-key="tile"
image-url-key="image.url"
:filter="{ organizationId: 'xxx' }"
loading-text="Posts are loading"
/>
Props
| Property | Type | Values | Description | Default |
|---|---|---|---|---|
| modelValue | any | any | binding value | |
| filter | Record<string, unknown> | Record | filter object for query | |
| entityType | String | String | entity name | |
| label | String | String | label text | |
| placeholder | String | String | placeholder text | Enter search query |
| idKey | String | String | value that get from database as a id for each of items | id |
| labelKey | String | String | value that get from database as a label for each of items | title |
| imageUrlKey | String | String | value that get from database as a image for each of items | |
| defaultImageUrl | String | String | default imageUrl that shoud displayed if there ara no imageUrlKey in database | |
| limit | Number | Number | maximum number of items to get from database | 10 |
| multiple | boolean | truefalse | whether use can select more that one option | false |
| readonly | Boolean | Boolean | whether component is read only | false |
| disabled | Boolean | Boolean | whether component is disabled | false |
| error | Boolean | Boolean | determine if the component has error and change its style to that state. | false |
| errorMsg | String | String | error message | |
| enabled | Boolean | Boolean | value of query options enabled field | square |
| fetchFields | String[] | String[] | array of additional fetch fields | |
| clearable | boolean | truefalse | whether show clearable button | false |
| loadingText | String | String | displayed text while loading data from server | |
| allowCreate | Boolean | Boolean | whether creating new items is allowed. | false |
| createLabelText | String | String | creating text in option (use when `allowCreate` is true) | Add |
| createMethod | Function | Function | create method | |
| noDataText | String | String | text in popover when there are no options | No date |
| excludeIds | String[] | String[] | ids of options that should be excluded from select options | No date |
Slots
| Property | Type | Values | Description | Default |
|---|---|---|---|---|
| label-suffix | - | customize label suffix content |
Events
| Property | Type | Values | Description | Default |
|---|---|---|---|---|
| update:model-value | Function | value - SelectOptionValue | triggers when the selected value changes, | |
| entity-change | Function | value - Item Option | triggers when the selected value changes | |
| clear | Function | - | triggers when the clear icon is clicked in a clearable Select | |
| visible-change | Function | value - boolean | triggers when the dropdown appears/disappears | |
| focus | Function | - | triggers when Select focuses |