Dependencies: Difference between revisions
Created page with "{ "title": "Dependencies", "type": "object", "format": "grid", "properties": { "_text1": { "title": "Dependencies Example", "type": "string", "format": "hidden", "description": "\u003Cp\u003EThis example shows the use of the \u003Cstrong\u003Edependencies\u003C/strong\u003E option, where you can have a field depend on the value of another field.\u003C/p\u003E\u003Cp\u003EThis works by creating all dependant element and then hide/show the selected one. S..." |
(No difference)
|
Revision as of 07:58, 4 November 2025
{ "title": "Dependencies", "type": "object", "format": "grid", "properties": { "_text1": { "title": "Dependencies Example", "type": "string", "format": "hidden", "description": "\u003Cp\u003EThis example shows the use of the \u003Cstrong\u003Edependencies\u003C/strong\u003E option, where you can have a field depend on the value of another field.\u003C/p\u003E\u003Cp\u003EThis works by creating all dependant element and then hide/show the selected one. So this feature works best if fields are placed vertically.\u003C/p\u003E", "options": { "grid_columns": 12 } }, "category": { "title": "Category", "type": "string", "enum": [ "Chocolates", "Vegetables", "Icecreams" ] }, "subcategory1": { "title": "Subcategory", "type": "string", "enum": [ "Dark chocolate", "Milk chocolate", "White chocolate", "Gianduja chocolate" ], "options": { "dependencies": { "category": "Chocolates" }, "grid_columns": 12 } }, "subcategory2": { "title": "Subcategory", "type": "string", "enum": [ "Broccoli", "Cabbage", "Carrot", "Tomato" ], "options": { "dependencies": { "category": "Vegetables" }, "grid_columns": 12 } }, "subcategory3": { "title": "Subcategory", "type": "string", "enum": [ "Frozen yogurt", "Booza", "Ice milk" ], "options": { "dependencies": { "category": "Icecreams" }, "grid_columns": 12 } }, "_text2": { "title": "Using Checkbox", "type": "string", "format": "hidden", "description": "\u003Cp\u003EYou can also use boolean checkbox with dependencies.\u003C/p\u003E", "options": { "grid_columns": 12 } }, "billing": { "title": "Billing address same as shipping address", "type": "boolean", "format": "checkbox", "default": false, "options": { "grid_columns": 12 } }, "billingaddress": { "title": "Billing address", "type": "string", "options": { "dependencies": { "billing": false }, "grid_columns": 12 } } } }