04.04-reference.md 2.55 KB
Newer Older
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
---
source: sections/_guide_builder/04.04-reference.md
bookmark: library-reference
name: Reference
title: Function reference
sub: true
---

An `Builder` instance exposes the following properties and methods:

##### **Builder.open**(*definition*, *properties*): *Builder*
{: .method }
{: .static }
Creates a new builder instance, opens it and returns a reference to it.

`definition`
: Specifies the form definition to load (supply `undefined` to open an empty one).

`properties`
: Specifies the builder [configuration](#library-options).

##### **constructor**(*properties*): *Builder*
{: .method }
Creates a new builder instance.

`properties`
: Specifies the builder [configuration](#library-options).

##### **definition**
{: .property }
Sets or retrieves the form definition.

##### **onLoad**
{: .property }
{: .event }
Invoked when the builder is loaded.

##### **onReady**
{: .property }
{: .event }
Invoked when the builder is ready to use.

##### **onOpen**
{: .property }
{: .event }
Invoked when the builder is opened.

##### **onSave**
{: .property }
{: .event }
Invoked when the definition is saved.

##### **onChange**
{: .property }
{: .event }
Invoked when the definition is changed.

##### **onClose**
{: .property }
{: .event }
Invoked when the definition is changed.

##### **open**(*definition*): *Builder*
{: .method }
Opens the builder. Returns a reference to the builder instance.

`definition`
: Specifies the form definition to load *(optional)*.

##### **resize**(): *Builder*
{: .method }
Notifies the builder about a parent element resize. If you host the builder inside a custom element, you should invoke this method when the dimensions of the element are changed. This way the builder can adapt to the new viewport. Returns a reference to the builder instance.

##### **load**(*definition*): *Builder*
{: .method }
Loads a form definition. Returns a reference to the builder instance.

`definition`
: Specifies the form definition to load.

##### **restore**(): *Builder*
{: .method }
Restores to the last loaded or saved definition. Returns a reference to the builder instance.

##### **save**(): *IDefinition | undefined*
{: .method }
Saves the form definition and returns it.

##### **edit**(): *Builder*
{: .method }
Opens the definition edit form where the name of the form can be set. Returns a reference to the builder instance.

##### **clear**(): *Builder*
{: .method }
Clears the form (creates a new empty one). Returns a reference to the builder instance.

##### **close**(): *Builder*
{: .method }
Closes the builder. Returns a reference to the builder instance.