Created
February 6, 2014 15:33
-
-
Save frequent/8846484 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loading > index.html#{"level 1 - module"}/{"level 2 - item"} | |
[ | |
// level 1: | |
{ | |
"property_dict": { | |
"title": "Servers" | |
}, | |
"view_dict": { | |
"default": [{"href": "network_overview"}], | |
"new": [{"href": "network_new"}] | |
} | |
}, | |
// level 2: | |
{ | |
"property_dict": { | |
"title": "Network Instance" | |
}, | |
"view_dict": { | |
"default": [ | |
{"href": "network_status"}, | |
{"href": "network_assigned_computers"} | |
], | |
"config": [{"href": ...}] | |
} | |
] | |
} | |
// ======================================================================= | |
> will load | |
a) gadget ~ "form definition" | |
> will load | |
> b) fields | |
> c) record(s) | |
// ======================================================================= | |
a) "form definition" | |
{ | |
"portal_type_source": "Network", | |
"portal_type_title": "network", | |
"portal_type_fields": "network_fieldlist", | |
"property_dict": { | |
"submit_to": "#networks/__id__" | |
}, | |
"scheme": [ | |
{"position": "left", | |
"field_list": [ | |
{ | |
"field": "title", | |
"overrides": { | |
"widget": { | |
"css_class": "foo", | |
"default_value": "some" | |
}, | |
"properties": { | |
"required":false | |
} | |
} | |
} | |
] | |
} | |
], | |
"children": [ | |
// the form | |
{ | |
"generate": "widget", | |
"type": "form", | |
"property_dict": { | |
"class_list": "responsive", | |
"dynamic": true, | |
"map_children":"formItem", | |
"editable": true, | |
"secure": "default", | |
"secret_hash": "foo", | |
"public_key": "6Ldpb-oSAAAAAGwriKpk4ol1n4yjN_as6M4xv0zA" | |
}, | |
"children": [ | |
// action buttons | |
{ | |
"generate": "widget", | |
"type": "controlgroup", | |
"class_list": "center", | |
"property_dict": { | |
"direction": "horizontal" | |
}, | |
"children": [ | |
{ | |
"type": "input", | |
"direct": {"value": "Submit", "className": "action translate"}, | |
"attributes": {"type": "submit", "data-action":"add", "data-icon":"save"} | |
] | |
}] | |
} | |
] | |
} | |
// ======================================================================= | |
b) "field_definition" | |
{ | |
"title": { | |
"type": "StringField", | |
"widget": { | |
"id": "title", | |
"title": "Title", | |
"title_i18n": "portal_type_dict.network_dict.field_dict.title.title", | |
"description": "The name of your network.", | |
"description_i18n": "portal_type_dict.network_dict.field_dict.title.description", | |
"alternate_name": "title", | |
"default_value": null, | |
"css_class": null, | |
"hidden": false, | |
"display_width": 30, | |
"maximum_input": null, | |
"extra": {"data-clear-btn":"true"} | |
}, | |
"properties": { | |
"enabled": true, | |
"editable": true, | |
"external_validator": null, | |
"required": true, | |
"preserve_whitespace": null, | |
"unicode": null, | |
"maximum_length": 10, | |
"truncate": null | |
}, | |
"messages": { | |
"external_validator_failed": { | |
"message": "The input failed the external validator.", | |
"i18n": "validation_dict.external" | |
}, | |
"required_not_found": { | |
"message": "Input is required but no input given.", | |
"i18n": "validation_dict.required" | |
}, | |
"too_long": { | |
"message":"Too much input given.", | |
"i18n": "validation_dict.too_much_input" | |
} | |
} | |
}, | |
... | |
} | |
// c) JIO query dynamic data | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment