fieldtemplates.html 10.6 KB
Newer Older
Rafael Ostertag's avatar
Rafael Ostertag committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">


    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="../css/jqx.base.css">
    <link rel="stylesheet" href="../css/jqx.bootstrap.css">
    <link rel="stylesheet" href="../css/qfq-bs.css">

    <title>Field Templates</title>
</head>
<body>

Rafael Ostertag's avatar
Rafael Ostertag committed
19
20
21
22
<div class="container-fluid">
    <div class="row hidden-xs">
        <div class="col-md-12">
            <h1>Title with a long text</h1>
Rafael Ostertag's avatar
Rafael Ostertag committed
23
24
        </div>
    </div>
Rafael Ostertag's avatar
Rafael Ostertag committed
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

    <div class="row">
        <div class="col-md-12 ">
            <div class="btn-toolbar pull-right" role="toolbar">
                <div class="btn-group" role="group">
                    <button id="save-button" type="button" class="btn btn-default navbar-btn"
                            data-class-on-change="wdc"><span
                            class="glyphicon glyphicon-ok"></span></button>
                    <button id="close-button" type="button" class="btn btn-default navbar-btn"><span
                            class="glyphicon glyphicon-remove"></span></button>
                </div>
                <div class="btn-group" role="group">
                    <button id="delete-button" type="button" class="btn btn-default navbar-btn"><span
                            class="glyphicon glyphicon-trash"></span></button>
                </div>
                <div class="btn-group" role="group">
                    <a id="form-new-button" href="personmock.html?s=badcaffe1" class="btn btn-default navbar-btn"><span
                            class="glyphicon glyphicon-plus"></span></a>
                </div>
            </div>
Rafael Ostertag's avatar
Rafael Ostertag committed
45
        </div>
Rafael Ostertag's avatar
Rafael Ostertag committed
46

Rafael Ostertag's avatar
Rafael Ostertag committed
47
    </div>
Rafael Ostertag's avatar
Rafael Ostertag committed
48
49
50
51
52
53
54
55
    <form id="myForm" class="form-horizontal" data-toggle="validator">
        <input type="hidden" name="s" value="badcaffee1234">
        <div class="form-group">
            <div class="col-md-2">
                <b class="control-label">Fotowand</b>
            </div>
            <div class="col-md-6 qfq-fields" id="target"
                 data-qfq-line-template="#template">
Rafael Ostertag's avatar
Rafael Ostertag committed
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
                <div class="form-inline qfq-line">
                    <div class="form-group">
                        <label for="id1_1" class="control-label">Zeile (A-K) 1</label>
                        <input id="id1_1" type="text" class="form-control" name="name1_1">
                    </div>
                    <div class="form-group">
                        <label for="id2_1" class="control-label">Zeile (1-10) 1</label>
                        <input id="id2_1" type="text" class="form-control" name="name2_1">
                    </div>

                    <div class="form-group">
                        <div class="checkbox">
                            <label>
                                <input type="checkbox" name="name3_1">Zweizeilig
                            </label>
                        </div>
                    </div>
                </div>

                <div class="form-inline qfq-line">
                    <div class="form-group">
                        <label for="id1_2" class="control-label">Zeile (A-K) 2</label>
                        <input id="id1_2" type="text" class="form-control" name="name1_2">
                    </div>
                    <div class="form-group">
                        <label for="id2_2" class="control-label">Zeile (1-10) 2</label>
                        <input id="id2_2" type="text" class="form-control" name="name2_2">
                    </div>

                    <div class="form-group">
                        <div class="checkbox">
                            <label>
                                <input type="checkbox" name="name3_2">Zweizeilig
                            </label>
                        </div>
                    </div>

                    <div class="form-group qfq-delete-button">
                        <button type="button" onclick="QfqNS.removeThisChild(this)">Remove</button>
                    </div>
                </div>
Rafael Ostertag's avatar
Rafael Ostertag committed
98
            </div>
99
        </div>
Rafael Ostertag's avatar
Rafael Ostertag committed
100
101
102
103
104
105
        <div class="form-group">
            <div class="col-md-1">
                <button type="button" onclick="QfqNS.appendTemplate('#template', '#target', 10)">Add</button>
            </div>
        </div>
    </form>
106

Rafael Ostertag's avatar
Rafael Ostertag committed
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
    <form id="myForm2" class="form-horizontal" data-toggle="validator">
        <input type="hidden" name="s" value="badcaffee1234">
        <div class="form-group">
            <div class="col-md-2">
                <b class="control-label">Fotowand</b>
            </div>
            <div class="col-md-6 qfq-fields" id="target2"
                 data-qfq-line-template="#template">
                <div class="form-inline qfq-line">
                    <div class="form-group">
                        <label for="id21_1" class="control-label">Zeile (A-K) 1</label>
                        <input id="id21_1" type="text" class="form-control" name="name1_1" value="value 1">
                    </div>
                    <div class="form-group">
                        <label for="id22_1" class="control-label">Zeile (1-10) 1</label>
                        <input id="id22_1" type="text" class="form-control" name="name2_1" value="value 1">
123
124
                    </div>

Rafael Ostertag's avatar
Rafael Ostertag committed
125
126
127
128
129
130
131
                    <div class="form-group">
                        <div class="checkbox">
                            <label>
                                <input type="checkbox" name="name3_1">Zweizeilig
                            </label>
                        </div>
                    </div>
132
133
134

                </div>

Rafael Ostertag's avatar
Rafael Ostertag committed
135
136
137
138
139
140
141
142
                <div class="form-inline qfq-line">
                    <div class="form-group">
                        <label for="id21_2" class="control-label">Zeile (A-K) 2</label>
                        <input id="id21_2" type="text" class="form-control" name="name1_2" value="value 2">
                    </div>
                    <div class="form-group">
                        <label for="id22_2" class="control-label">Zeile (1-10) 2</label>
                        <input id="id22_2" type="text" class="form-control" name="name2_2" value="value 2">
143
144
                    </div>

Rafael Ostertag's avatar
Rafael Ostertag committed
145
146
147
148
149
150
151
                    <div class="form-group">
                        <div class="checkbox">
                            <label>
                                <input type="checkbox" name="name3_2">Zweizeilig
                            </label>
                        </div>
                    </div>
152

Rafael Ostertag's avatar
Rafael Ostertag committed
153
154
155
                    <div class="form-group qfq-delete-button">
                        <button type="button" onclick="QfqNS.removeThisChild(this)">Remove</button>
                    </div>
156
157
                </div>

Rafael Ostertag's avatar
Rafael Ostertag committed
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
                <div class="form-inline qfq-line">
                    <div class="form-group">
                        <label for="id21_3" class="control-label">Zeile (A-K) 3</label>
                        <input id="id21_3" type="text" class="form-control" name="name1_3" value="value 3">
                    </div>
                    <div class="form-group">
                        <label for="id22_3" class="control-label">Zeile (1-10) 3</label>
                        <input id="id22_3" type="text" class="form-control" name="name2_3" value="value 3">
                    </div>

                    <div class="form-group">
                        <div class="checkbox">
                            <label>
                                <input type="checkbox" name="name3_3">Zweizeilig
                            </label>
                        </div>
174
175
                    </div>

Rafael Ostertag's avatar
Rafael Ostertag committed
176
177
178
                    <div class="form-group qfq-delete-button">
                        <button type="button" onclick="QfqNS.removeThisChild(this)">Remove</button>
                    </div>
179
180
181
                </div>
            </div>
        </div>
Rafael Ostertag's avatar
Rafael Ostertag committed
182
183
184
185
        <div class="form-group">
            <div class="col-md-1">
                <button type="button" onclick="QfqNS.appendTemplate('#template2', '#target2', 10)">Add</button>
            </div>
186
        </div>
Rafael Ostertag's avatar
Rafael Ostertag committed
187
188
    </form>
</div>
189

Rafael Ostertag's avatar
Rafael Ostertag committed
190
191
192
<script id="template" type="text/template">
    <div class="form-inline qfq-line">
        <div class="form-group">
193
            <label for="id1_%d" class="control-label">Zeile (A-K) %d</label>
Rafael Ostertag's avatar
Rafael Ostertag committed
194
195
196
            <input id="id1_%d" type="text" class="form-control" name="name1_%d">
        </div>
        <div class="form-group">
197
            <label for="id2_%d" class="control-label">Zeile (1-10) %d</label>
Rafael Ostertag's avatar
Rafael Ostertag committed
198
            <input id="id2_%d" type="text" class="form-control" name="name2_%d">
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
        </div>

        <div class="form-group">
            <div class="checkbox">
                <label>
                    <input type="checkbox" name="name3_%d">Zweizeilig
                </label>
            </div>
        </div>

        <div class="form-group qfq-delete-button">
            <button type="button" onclick="QfqNS.removeThisChild(this)">Remove</button>
        </div>
    </div>
</script>

<script id="template2" type="text/template">
    <div class="form-inline qfq-line">
        <div class="form-group">
            <label for="id21_%d" class="control-label">Zeile (A-K) %d</label>
            <input id="id21_%d" type="text" class="form-control" name="name1_%d">
        </div>
        <div class="form-group">
            <label for="id22_%d" class="control-label">Zeile (1-10) %d</label>
            <input id="id22_%d" type="text" class="form-control" name="name2_%d">
Rafael Ostertag's avatar
Rafael Ostertag committed
224
225
226
227
228
229
230
231
232
233
234
        </div>

        <div class="form-group">
            <div class="checkbox">
                <label>
                    <input type="checkbox" name="name3_%d">Zweizeilig
                </label>
            </div>
        </div>

        <div class="form-group qfq-delete-button">
235
            <button type="button" onclick="QfqNS.removeThisChild(this)">Remove</button>
Rafael Ostertag's avatar
Rafael Ostertag committed
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
        </div>
    </div>
</script>

<script src="../js/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>

<script src="../js/validator.min.js"></script>

<script src="../js/jqx-all.js"></script>
<script src="../js/globalize.js"></script>
<script src="../js/tinymce.min.js"></script>
<script src="../js/EventEmitter.min.js"></script>
<script src="../js/qfq.debug.js"></script>


<script type="text/javascript">
    $(function () {
Rafael Ostertag's avatar
Rafael Ostertag committed
254
255
256
257
258
259
        var qfqPage = new QfqNS.QfqPage({
            tabsId: 'myTabs',
            formId: 'myForm',
            typeAheadUrl: 'api/typeahead.php'
        });

Rafael Ostertag's avatar
Rafael Ostertag committed
260
261
        $(".qfq-fields").each(
            function () {
262
                QfqNS.initializeTemplateTarget(this);
Rafael Ostertag's avatar
Rafael Ostertag committed
263
264
            }
        );
Rafael Ostertag's avatar
Rafael Ostertag committed
265

Rafael Ostertag's avatar
Rafael Ostertag committed
266
267
268
269
    });
</script>
</body>
</html>