json-schema-form/angular-schema-form

Condition for nested array?

person2713 opened this issue · 1 comments

I have some example:

`
{
  "schema": {
  "type": "object",
  "properties": {
	"name": {
		"type": "string"
	},
	"Objects": {
		"type": "array",
		"items": {
			"type": "object",
			"properties": {
				"object": {
					"type": "object",
					"properties": {
						"objectId": {
							"type": "string"
						},
						"objectName": {
							"type": "string"
						},
						"attributes": {
							"type": "array",
							"items": {
								"type": "object",
								"properties": {
									"attributeId": {
										"type": "string"
									},
									"attributeName": {
										"type": "string"
									},
									"value": {
										"type": "string"
									}
								}
							}
						}
					}
				}
			}
		}
	}
  }
},
  "form": [
      {
        key: 'name'
      },
      {
        key: 'Objects',
        type: 'array',
        items: [
          {
            key: 'Objects[].object',
            items: [
              {
                key: 'Objects[].object.objectId'
              },
              {
                key: 'Objects[].object.objectName',
                condition: 'model.Objects[arrayIndex].object.objectId',
                readonly: 'true'
              },
              {
                key: 'Objects[].object.attributes',
                type: 'array',
                items: [
                  {
                    key: 'Objects[].object.attributes[].attributeId'
                  },
                  {
                    key: 'Objects[].object.attributes[].attributeName',
                    condition: 'model.Objects[arrayIndices[0]].object.attributes[arrayIndices[1]].attributeId',
                    readonly: 'true'
                  },
                  {
                    key: 'Objects[].object.attributes[].value'
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        type: 'section',
        htmlClass: 'row',
        items: [
          {
            type: 'section',
            htmlClass: 'col-md-1',
            items: [
              {
                type: 'submit',
                title: 'Add'
              }
            ]
          }
        ]
      }
    ]
}
`

on https://angular2-json-schema-form.firebaseapp.com/?set=asf&example=asf-array&framework=bootstrap-4&language=en.
There are any idea?
P. S. I read #742 but it does't work.

@person2713 There is no relationship between angular2-json-schema-form and angular-schema-form.