formupdate.html 6.5 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!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.darkblue.css">
    <link rel="stylesheet" href="../css/qfq-bs.css">
    <title>Element Configuration</title>
</head>
<body>

17
18
19
20
21
22
23
24
<label>Refresh URL
    <select name="refreshUrl" id="refreshUrl">
        <option>404 error</option>
        <option>form_refresh.json</option>
        <option>form_refresh_error.json</option>
    </select>
</label>

25
26
<div style="float: right">
<pre id="sample">
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
    [
    {
      "form-element": "text",
      "value": "value. Now its enabled",
      "disabled": false,
      "readonly": true
    },
    {
      "form-element": "select",
      "value": [
        {
          "value": 100,
          "text": "a",
          "selected": true
        },
        {
          "value": 200,
          "text": "b",
          "selected": false
        }
      ]
    },
    {
      "form-element": "radio",
      "value": "a",
      "disabled": false
    },
    {
      "form-element": "checkbox",
      "value": true,
      "readonly": true
    },
    {
      "form-element": "trigger",
      "value": false
    }
  ]
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
</pre>
    <button id="copy">Copy</button>
</div>
<p>
    <textarea name="configuration" rows="20" cols="80" id="configuration"></textarea>
</p>

<p>
    <button id="applyconfig">Apply</button>
</p>


<div class="container-fluid">
    <div class="row hidden-xs">
        <div class="col-md-12">
            <h1>Title with a long text</h1>
        </div>
    </div>


84
    <form id="myForm" class="form-horizontal" data-toggle="validator">
85
86
87
88
89
90
91

        <div class="form-group">
            <div class="col-md-2">
                <label for="text" class="control-label">Text input (name: text)</label>
            </div>

            <div class="col-md-6">
92
                <input id="text" type="text" class="form-control" name="text" data-disabled="true">
93
94
95
96
97
98
99
100
            </div>

        </div>

        <div class="form-group">
            <div class="col-md-2">
                <label for="select" class="control-label">Select (name: select)</label>
            </div>
101
            <input type="hidden" name="select">
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
            <div class="col-md-6">
                <select id="select" class="form-control" name="select">
                    <option>a</option>
                    <option>b</option>
                    <option>c</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-2">
                <b class="control-label">
                    Radio (name: radio)
                </b>
            </div>

            <div class="col-md-6">
                <div class="radio">
                    <label>
                        <input type="radio" name="radio" value="a">a
                    </label>
                </div>
124
                <input type="hidden" name="radio">
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
                <div class="radio">
                    <label>
                        <input type="radio" name="radio" value="b">b
                    </label>
                </div>
            </div>
            <div class="col-md-4">
                <p class="help-block"></p>
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-2">
                <b class="control-label">
                    Checkbox (name: checkbox)
                </b>
            </div>

            <div class="col-md-6">
144
                <input type="hidden" name="checkbox">
145
146
                <div class="checkbox">
                    <label>
147
                        <input type="checkbox" id="checkbox" name="checkbox" data-hidden="no">
148
149
150
151
152
153
154
                    </label>

                    <p class="help-block"></p>
                </div>
            </div>
        </div>

155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
        <div class="form-group">
            <div class="col-md-2">
                <b class="control-label">
                    Data reload trigger
                </b>
            </div>

            <div class="col-md-6">
                <div class="checkbox">
                    <label>
                        <input type="checkbox" id="checkbox2" name="trigger" data-load="">
                    </label>

                    <p class="help-block">
                        Changing the value of this checkbox triggers reload
                    </p>
                </div>
            </div>
        </div>
174

175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
        <div class="form-group">
            <div class="col-md-2">
                <b class="control-label">
                    Checkbox 3 test
                </b>
            </div>


            <div class="col-md-6">
                <div class="checkbox">
                    <label>
                        <input name='checkbox3_1' type="checkbox" value="reminder_value">
                    </label>

                </div>
                <div class="checkbox">
                    <label>
                        <input name='checkbox3_2' type="checkbox" value="reminder_value">
                    </label>

                </div>
                <div class="checkbox">
                    <label>
                        <input name='checkbox3_3' type="checkbox" value="reminder_value">
                    </label>

                </div>
            </div>
            <div class="col-md-4">

            </div>
        </div>
207
208
209
210
211
    </form>
</div>

<script src="../js/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
212
<script src="../js/validator.min.js"></script>
213
<script src="../js/jqx-all.js"></script>
214
<script src="../js/EventEmitter.min.js"></script>
215
216
217
<script src="../js/qfq.debug.js"></script>
<script type="text/javascript">
    $(function () {
218
        var form = new QfqNS.QfqForm("myForm", 'none', 'none', 'api/' + $("#refreshUrl").val());
219
220
221
222
223
224
225
226
227
228
229
        QfqNS.Log.level = 0;

        $("#applyconfig").click(function () {
            var configAsText = $("#configuration").val();
            var configAsJson = JSON.parse(configAsText);

            form.applyElementConfiguration(configAsJson);
        });

        $("#copy").click(function () {
            $("#configuration").val($("#sample").text());
230
231
232
233
234
235
236
        });

        $("#refreshUrl").on("change", function (evt) {
            form.dataRefreshUrl = 'api/' + $(evt.target).val();
        });


237
238
239
240
    });
</script>
</body>
</html>