0

I'm creating a form using angular-json-schema-form, I have an array where the user can select a value from a drop-down menu, I would like to know if it is possible to remove from the drop-down menu options those already selected previously in order to do not have equal values.

I can disable the submit when there are equal values through uniqueItems, but what I would like is not to display the values in the options

this is my json-schema

"model":{
        "$schema":"http://json-schema.org/draft-07/schema#",
        "distinct":["campo_a"],
        "additionalProperties":false,
        "title":"test",
        "type":"object",
        "required":[],
        "properties":{
            "campo_a":{
                "title":"campo_a",
                "type":"string",
                "$id":"/properties/campo_a",
                "readonly":false
            },
            "campo_b":{
                "maxItems":3,
                "uniqueItems":true,
                "cdrType":"multi-language",
                "title":"multilingua field",
                "type":"array",
                "items":{
                    "type":"object",
                    "properties":{
                        "lang":{
                            "type":"string",
                            "title":"Lingua",
                            "enum":["it","fr","de"]
                        },
                        "trans":{
                            "type":"string",
                            "title":"traduzione"
                        }
                    },
                    "required":["lang","trans"]
                },
                "$id":"/properties/campo_b"
            }
        },
        "$id":"test",
        "data":{}
    }

In the link below is the image of how the form is shown, as you can see in the first select "it" is selected and I want that in the second select is not shown among the options form-layout

4

0 回答 0