-
Notifications
You must be signed in to change notification settings - Fork 641
Closed
Labels
Description
I like to update my schema after Form loader through onChange,
but schema not getting updated, Please refer the below controller code.
$scope.testOnchange = function() {
console.log('came here');
$scope.schema.properties.profileDetails.properties.address.properties.
addressDetails.items.properties.addressFormat = ['dym', 'dym1'];
$scope.$broadcast('schemaFormRedraw');
};
$scope.schema = {
"type": "object",
"title": "Comment",
"properties": {
"profileDetails": {
"type": "object",
"properties": {
"address": {
"type": "object",
"properties": {
"addressDetails": {
"title": "Contact Person",
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"addressType": {
"title": "Contact Type",
"description": "Select",
"type": "string",
"default": "test",
"enum": ["test", "test1"]
},
"addressFormat": {
"title": "Address Format",
"description": "Select",
"type": "string",
"default": "test",
"enum": []
}
}
}
}
}
}
}
}
}
};
$scope.form = [{
"key": "profileDetails.address.addressDetails",
"title": "The array",
"type": "array",
"items": [{
"key": "profileDetails.address.addressDetails[].addressType",
"onChange": "testOnchange()"
}, {
"key": "profileDetails.address.addressDetails[].addressFormat",
}
]
}, {
"type": "submit",
"style": "btn-info",
"title": "OK"
}
];