Hello @qy2009 yes you can PRE-SELECT stuff
New-UDSelector -Id "stuff" -Selected {
@{ value = "push"; label = "Push" },
@{ value = "pull"; label = "Pull" }
} -options {
@{ value = "push"; label = "Push" },
@{ value = "pull"; label = "Pull" },
@{ value = "jump"; label = "Jump" },
@{ value = "throw"; label = "Throw" }
@{ value = "kick"; label = "Kick" }
@{ value = "punch"; label = "Punch" }
}
Notice the -Selected parameter
Source GitHub - psDevUK/UD-Selector
I can put an example together on getting the value…there is an easier way to do the SQL stuff…This drop down list can handle thousands of results from SQL…Need to find a script I was using…there is a lot of info on this thread on the forum:-
This component originated from the request for help here:-
You can download this awesome component right here:-
PowerShell Gallery | UniversalDashboard.UDSelector 1.0.0
Once again I was blessed to receive some extra help from @BoSen29 who was very kind and donated his personal time to help on this project. I mean I build all these components in my spare time, so it’s great to receive some extra help, and some good banter at the same time.
I had actually managed to build the component, bin…
Boom…so glad I document stuff…please see the SQL sample in this README
# New-UDSelector
>Bringing react-select to universaldashboard
## Please Read this to figure this component out
This component does work, and is easy enough to build into any dashboard, but I needed a sub-function to get the values
imported into the select list nicely. Sadly I was able to figure out this when building this component through the plaster
template. So please read this guide to become a master at using this component...
### Step 1
To actually install the module via the marketplace or the powershell gallery
**Install-Module UniversalDashboard.UDSelector**
### Step 2
Import the module into your dashboard project:-
**Import-Module -Name UniversalDashboard.UDSelector**
## Populating the list from SQL
So I thought it would be super handy to automatically fill the select list with values I wanted the user to select from
```
This file has been truncated. show original