reactivesearch

ReactiveSearch onValueSelected


I have the following autocomplete setup that connects to my datasource:

<ReactiveBase
      app="XXXXX"
      credentials="XXXXX"
    >

      <DataSearch
        componentId="title"
        :dataField="[
          'name',
          'symbol',
        ]"
        className="data-search"
        :showClear="false"
        queryFormat="and"

      />

    </ReactiveBase>

I would like to just alert the value of the the selection, whenever I select one of the autocomplete suggestions.

I have tried adding the following:

    onValueSelected = {
      function (value) {
      alert(value)
      }
    }

But I get a Duplicate attribute '}' error

I am using Vue.

Thanks!


Solution

  • Instead of onValueSelected use @valueSelected. Check Event handling in Vue here.

    You can also check this link. I have updated the basic demo of DataSearch component present on docs to use valueSelected.

    You can read about the other events in DataSearch component here.