Dependencies: Difference between revisions

From Wikisphere
Jump to navigation Jump to search
No edit summary
 
No edit summary
 
Line 6: Line 6:
             "title": "Dependencies Example",
             "title": "Dependencies Example",
             "type": "string",
             "type": "string",
             "format": "hidden",
             "x-format": "hidden",
             "description": "<p>This example shows the use of the <strong>dependencies<\/strong> option, where you can have a field depend on the value of another field.<\/p><p>This works by creating all dependant element and then hide\/show the selected one. So this feature works best if fields are placed vertically.<\/p>",
             "description": "<p>This example shows the use of the <strong>dependencies<\/strong> option, where you can have a field depend on the value of another field.<\/p><p>This works by creating all dependant element and then hide\/show the selected one. So this feature works best if fields are placed vertically.<\/p>"
            "options": {
                "grid_columns": 12
            }
         },
         },
         "category": {
         "category": {
            "options": {
                "control": {
                    "config": {
                        "align": "left"
                    }
                }
            },
             "title": "Category",
             "title": "Category",
             "type": "string",
             "type": "string",
Line 37: Line 27:
                 "Gianduja chocolate"
                 "Gianduja chocolate"
             ],
             ],
             "options": {
             "x-dependency": {
                 "control": {
                 "category": "Chocolates"
                    "config": {
                        "align": "left"
                    }
                },
                "dependencies": {
                    "category": "Chocolates"
                },
                "grid_columns": 12
             }
             }
         },
         },
Line 58: Line 40:
                 "Tomato"
                 "Tomato"
             ],
             ],
             "options": {
             "x-dependency": {
                 "dependencies": {
                 "category": "Vegetables"
                    "category": "Vegetables"
                },
                "control": {
                    "config": {
                        "align": "left"
                    }
                },
                "grid_columns": 12
             }
             }
         },
         },
Line 78: Line 52:
                 "Ice milk"
                 "Ice milk"
             ],
             ],
             "options": {
             "x-dependency": {
                 "control": {
                 "category": "Icecreams"
                    "config": {
                        "align": "left"
                    }
                },
                "dependencies": {
                    "category": "Icecreams"
                },
                "grid_columns": 12
            }
        },
        "_text2": {
            "title": "Using Checkbox",
            "type": "string",
            "format": "hidden",
            "description": "<p>You can also use boolean checkbox with dependencies.<\/p>",
            "options": {
                "grid_columns": 12
             }
             }
         },
         },
Line 102: Line 59:
             "title": "Billing address same as shipping address",
             "title": "Billing address same as shipping address",
             "type": "boolean",
             "type": "boolean",
             "format": "checkbox",
             "x-input": "OO.ui.CheckboxInputWidget",
             "default": false,
             "default": false
            "options": {
                "grid_columns": 12
            }
         },
         },
         "billingaddress": {
         "billingaddress": {
             "title": "Billing address",
             "title": "Billing address",
             "type": "string",
             "type": "string",
             "options": {
             "x-dependency": {
                 "dependencies": {
                 "billing": false
                    "billing": false
                },
                "grid_columns": 12
             }
             }
         }
         }
     }
     }
}
}

Latest revision as of 00:00, 15 January 2001

title"Dependencies"
type"object"
properties
_text1
title"Dependencies Example"
type"string"
x-format"hidden"
description"<p>This example shows the use of the <strong>dependencies</strong> option, where you can have a field depend on the value of another field.</p><p>This works by creating all dependant element and then hide/show the selected one. So this feature works best if fields are placed vertically.</p>"
category
title"Category"
type"string"
enum
"Chocolates"
"Vegetables"
"Icecreams"
subcategory1
title"Subcategory"
type"string"
enum
"Dark chocolate"
"Milk chocolate"
"White chocolate"
"Gianduja chocolate"
x-dependency
category"Chocolates"
subcategory2
title"Subcategory"
type"string"
enum
"Broccoli"
"Cabbage"
"Carrot"
"Tomato"
x-dependency
category"Vegetables"
subcategory3
title"Subcategory"
type"string"
enum
"Frozen yogurt"
"Booza"
"Ice milk"
x-dependency
category"Icecreams"
billing
title"Billing address same as shipping address"
type"boolean"
x-input"OO.ui.CheckboxInputWidget"
defaultfalse
billingaddress
title"Billing address"
type"string"
x-dependency
billingfalse