-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
99 lines (89 loc) · 2.91 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
var renderedsMap = Uiml.htmlUiRendererPeers[0].dclasses;
renderedsMap.push({ id: "textInput", mapsto: "InputRenderer" });
renderedsMap.push({ id: "plainEditor", mapsto: "InputRenderer" });
Uiml.refresh();
FormBuilder.UimlPart.render = Uiml.render;
///////////////////////////////////////////////////////////////////////////////////////////////////
var layoutJson = {
partclass: "layoutRow",
cssClasses: "row test-form"
};
// layoutJson = {
// "id": "customer.public.customer.customer_id.payment.public.payment.customer_idPanel",
// "isRelation": true,
// "partclass": "panel",
// "visibleIndex": "customer.public.customer.customer_id.payment.public.payment.customer_id",
// "expanded": false,
// "cssClasses": "relation",
// "text": "payment",
// "customHeaderTemplate": "child-view-context-actions-template",
// "customBodyHeaderTemplate": "child-view-body-actions-template",
// "customHeaderData": "customer.public.customer.customer_id.payment.public.payment.customer_id",
// "parts": [
// {
// "id": "row2",
// "partclass": "layoutRow",
// "parts": [
// {
// "id": "customer.public.customer.customer_id.payment.public.payment.customer_idListView",
// "partclass": "child",
// "model": "customer.public.customer.customer_id.payment.public.payment.customer_id"
// }
// ]
// }
// ]
// };
layoutJson = {
"partclass": "layoutRow",
"cssClasses": "row test-form",
"parts": [
{
"partclass": "panel",
"text": "Test panel",
"parts": [
{
"partclass": "label",
"cssClasses": "test-label",
"text": "Name"
},
{
"partclass": "input",
"cssClasses": "test-input",
"data": "name"
}
]
},
{
"partclass": "input",
"cssClasses": "test-input",
"data": "name"
}
]
};
var model = {
name: "Tom",
surname: "Young",
zipcode: "103844",
city: "Kanzas",
address: "Mountain drive, 754",
phone: "2-300-765-11-22",
data: {
first_name: "Bob",
last_name: "Sallivan",
email: "bob@sallivan-family.org",
}
}
var model = FormBuilder.Form.show(model, layoutJson, document.getElementById("form-builder-container"));
// var toolboxItems = [].concat(FormBuilder.defaultToolboxItems);
// toolboxItems.push({
// title: "item",
// hint: "Drag to add item",
// json: {
// partclass: "layoutItem",
// cssClasses: "item",
// parts: [
// ]
// }
// });
// toolboxItems = toolboxItems.concat(FormBuilder.createToolboxItemsFor(model))
// FormBuilder.render(layoutJson, toolboxItems, model, document.getElementById("form-builder-container"));