-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Input field with multiple values from autocomplete #1039
Comments
I think that should be possible, the autocomplete function is quite flexible and customizable: with https://github.com/josdejong/jsoneditor/blob/develop/docs/api.md |
Perfect, It's working!! |
Awesome! Thanks for reporting back. I'll close this issue now. |
@josdejong this is a life-saver, thank you... But I am having trouble trying to implement a pick-list method for restricting a specific node to a limited set of choices. E.g. for a node called 'fruit', how can I limit the autocomplete to only allow ['apple','peach','mango']? But for another node 'pet', the autocomplete list should limit the inputs to ['cat','dog']. In other words, specific lists of allowed inputs for specific nodes. None of the examples seem to clearly explain this to me - can you point me in the right direction? |
@cpopolo you can maybe use a JSON Schema, which can provide an enum dropdown for a limited list of inputs, and shows a warning icon when the value is invalid. See the "gender" dropdown in https://github.com/josdejong/jsoneditor/blob/develop/examples/07_json_schema_validation.html. |
Thanks Jos, this is working nicely. I'm now deep into the rabbit hole of the 'schema' option which I knew I would need to get to at some point... A quick follow-up question if you can: I've read through the issue #57 about named enumerations and cannot seem to tell if that has been resolved. Is there an accepted way to show a list of enumerated options along with a brief description for each? There are certain fields in my structure that require a short code, but it would be far more helpful if the end-user could see a fuller description. This is an example where I have left it for now, but it neither behaves like a traditional 'enum', nor does it show any helpful 'description' text:
Thanks |
In JSONEditor, you cannot use
|
I see... The problem is that the "ba" list of options in my example can be quite long. I wonder if it's possible to build a render callback that would make the "enum" behave more like a element in HTML; where the option values are stored into the JSON, but the user sees a more useful list of descriptions. E.g., ISO New England NH... The JSON value would be set to "isone_nh" but the user selected "ISO New England NH" from the dropdown list. Perhaps an experiment for another day - you've been more than enough help already! |
Yeah I understand. The successor of this library, |
is it possible to add multiple value in string type field with autocomplete
like:
column_list: "id;name;email"
I never want to use array type of filed just want to continually add multiple value in a single filed with autocomplete
when start typing id show autocomplete then add ";" then again start typing in the same field such as "name" then autocomplete suggestion will show.
The text was updated successfully, but these errors were encountered: