Multiselect inputValue

  • Goal: I'd like to trigger an event when someone adds or removes a value from a multiselect component. and use the value as party of a query.

  • Details: inputValue seems like the ticket, but this property is never populated. What is this property used for?

  • Screenshots:

Thanks in advance!

Hey @awilly,

inputValue is related more to whatever the user types in in order to search values within the options.

The multiselect component's event handler has a "on Change" option which you can use to trigger a query, and you can use the last value of your selected values as reference for your query.

Thank you! Which property contains the selected values? Is it selectedItems?

So:

  • multiselect1.value, which will contain all of the actual values selected, e.g. multiselect1.value[0] may return something like 45
  • multiselect1.selectedItems, will contain an array for each item containing all the info for the selected item, e.g. for the same result as above you will need to write multiselect1.selectedItems[0].id

So if the data source for your multiselect, contains several properties for each array, then you will be able to access those properties for the selected Items through this last one.

As it seems you only need the values, I think you can go with the first option

Got it. Thanks! You have answered my question about the purpose of the inputValue property.

One of my hopes of using the inputValue (as I understood it), was deleting a single row from a SQL Server table when someone deleted a value from multiselect. Add a value, add a row. Delete a value, delete a row. I can create a separate topic for that larger question.

1 Like