jdorn / json-editor

JSON Schema Based Editor
MIT License
5.8k stars 1.08k forks source link

Is there a way to have a title and value for the checkbox object? #818

Closed dolv closed 6 years ago

dolv commented 6 years ago

Hi, I have the object like this:

"events": {
    "type": "array",
    "uniqueItems": true,
    "format": "checkbox",
    "minLength": 1,
    "items":{
        "type": "string",
        "enum": ["Induction event","Shipping event"]
    },
    "default": ["Induction event","Shipping event"]
}

I'd like to have a possibility to get mapped from title to values array from the checkbox array object according to the following map:

"eventsToValuesMAP": {
    "Induction event": "IND",
    "Shipping event": "SHP"
}

How to properly define the "events" to get desired effect? Thank you in advance.

schmunk42 commented 6 years ago

https://github.com/jdorn/json-editor#deprecation-notice

https://github.com/json-editor/json-editor/issues/44

dolv commented 6 years ago

Thank you for your time. Created new issue in the reffered repo https://github.com/json-editor/json-editor/issues/67

dolv commented 6 years ago

The issue has been resolved in json-editor/json-editor#67

the result could be found here:

https://json-editor.github.io/json-editor/?schema=N4IgLglmA2CmIC4QFEBusB2YDOIA04AngA7xID2ARgFawDGY+IxATuaS5LLgqLOlh6hIMMigE4mYEmICGLFrMJMArhggBHFbACSYWAFseYFtoIAzciwOzGSOgAt6Aa0rkAHkwMQMAGUwA5mAOiACMBFCGQkSkiCDYJj4BTJgqBogA2iA6GAAmKgwQ5BgABPyYjAQAyg4QxMRJZRIgALoE7JDF0akGAPoicDxZOgByACJMVQASAAqtAL7zBLmw5rIq0HbDeQWdpeVYk7X1jQeMLYvzQA=&value=N4IgpgbmB2AuDOIBcBtEBJaATArgY1gEsB7aAAkhlhABoQBlAC0IAcXDoBzCqOEAXQC+QA==&theme=bootstrap2&iconlib=fontawesome4&object_layout=normal&show_errors=interaction

dolv commented 6 years ago

The issue has been resolved