json-editor
json-editor copied to clipboard
Filtering array in "select" mode
I am using json-editor mainly as a subcomponent of Jenkins' Extended Choice Parameter Plugin.
I have an array of strings which I would like to filter using a regular expression. The regular expression is provided by user in another field as in this example.
I thought I could make an array which has enumSource with filtering attached but I'm having trouble doing that. No matter what I try, the array is always rendered as an array of select's as in here. Is there any way to reach the desired behaviour apart from introducing custom JavaScript to the page?
I am sure I want an array here, 'hosts' is plural :) Besides, your example doesn't work even for a string - filter doesn't make a difference.
In other words, I want to select X hosts from a filtered list of hosts, where the filter is a dynamically specified string and the source (unfiltered) list is static.
Oh I see. I misread sorry.