json-editor icon indicating copy to clipboard operation
json-editor copied to clipboard

Filtering array in "select" mode

Open mnarusze opened this issue 9 years ago • 3 comments

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?

mnarusze avatar Sep 26 '16 10:09 mnarusze

Well you defined an array of strings. Instead you just want a string:

example

Rybadour avatar Jul 19 '17 16:07 Rybadour

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.

mnarusze avatar Jul 20 '17 08:07 mnarusze

Oh I see. I misread sorry.

Rybadour avatar Jul 20 '17 14:07 Rybadour