Clear from a multi-select option

588
2
12-14-2022 02:44 PM
Labels (1)
saraswathiemani2
New Contributor III

Hi All.

 I used the multi-select from Jimu library in a custom application. is there a way to clear the selection from the form?

saraswathiemani2_0-1671057142751.png

The custom tool is developed for selecting multiple options from drop down. User checks the check box to select the feature. And the search option (Search button) renders the selection on the map correctly. The clear button clears the selection from the map but not from the check box and the form where it displays the selection. Is there a way to clear the selection from the form also.

saraswathiemani2_1-1671057486917.png

I want to clear the options above programmatically. 

getTRSMultiSelectOptions = (option: TRSOption) => {
    return option.units.map((item) => ({
      label: item,
      value: item,
    }));
  };

  

0 Kudos
2 Replies
chapmunnhsc
New Contributor III

Did you ever figure this out? I'm in the exact same spot.

0 Kudos
saraswathiemani2
New Contributor III

I was able to solve the issue by adding a clear button to the side, which when the user clicks clears all of the selections. I will try to check if I have the code to share it with you, but might take 2-3 days to access the code, as I don’t have access to my computer currently.

0 Kudos