koumoul-dev / vuetify-jsonschema-form

Create beautiful and low-effort forms that output valid data. Published on npm as @koumoul/vjsf.
https://koumoul-dev.github.io/vuetify-jsonschema-form/latest/
MIT License
546 stars 155 forks source link

Different display options for array of objects #372

Closed JenyaPodi closed 2 months ago

JenyaPodi commented 2 years ago

I have several array of objects and need to apply different display options for them:

  1. One array needs to have editMode: "inline" and another one editMode: "dialog"
  2. One array needs to be to have all options for arrayOperations, another array has to have no arrayOperations(it is only to display info without ability to edit)

When setting functionality through options, they are applied to both arrays. options: { context: { displayStatus: false }, summary: false, disableAll: false, markdownit: { html: true }, editMode: "inline", arrayOperations: [ "create", "update", "delete" ] }

Can you @albanm, please, point me how can I achieve desired functionality? Thank you

dominikhorn93 commented 2 years ago

hi @JenyaPodi you can set specific x-options on each element that override the global options

{
          "type": "object",
          "properties": {
            "objectList": {
              "title": "Object-List",
              "type": "array",
              "x-options": {
                "editMode": "inline"
              },
              "items": {
                "type": "object",
                "properties": {}
              }
            }
          }
}