Skip to content
On this page

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

PropertyType Values Description Default
modelValueanyanybinding value
filterRecord<string, unknown>Record unknown>filter object for query
entityTypeStringStringentity name
labelStringStringlabel text
placeholderStringStringplaceholder textEnter search query
idKeyStringStringvalue that get from database as a id for each of itemsid
labelKeyStringStringvalue that get from database as a label for each of itemstitle
imageUrlKeyStringStringvalue that get from database as a image for each of items
defaultImageUrlStringStringdefault imageUrl that shoud displayed if there ara no imageUrlKey in database
limitNumberNumbermaximum number of items to get from database10
multiplebooleantruefalsewhether use can select more that one optionfalse
readonlyBooleanBooleanwhether component is read onlyfalse
disabledBooleanBooleanwhether component is disabledfalse
errorBooleanBooleandetermine if the component has error and change its style to that state.false
errorMsgStringStringerror message
enabledBooleanBooleanvalue of query options enabled fieldsquare
fetchFieldsString[]String[]array of additional fetch fields
clearablebooleantruefalsewhether show clearable buttonfalse
loadingTextStringStringdisplayed text while loading data from server
allowCreateBooleanBooleanwhether creating new items is allowed.false
createLabelTextStringStringcreating text in option (use when `allowCreate` is true)Add
createMethodFunctionFunctioncreate method
noDataTextStringStringtext in popover when there are no optionsNo date
excludeIdsString[]String[]ids of options that should be excluded from select optionsNo date

Slots

PropertyType Values Description Default
label-suffix-customize label suffix content

Events

PropertyType Values Description Default
update:model-valueFunctionvalue - SelectOptionValuetriggers when the selected value changes,
entity-changeFunctionvalue - Item Optiontriggers when the selected value changes
clearFunction-triggers when the clear icon is clicked in a clearable Select
visible-changeFunctionvalue - booleantriggers when the dropdown appears/disappears
focusFunction-triggers when Select focuses

Created by DeepVision Software.