typeahead.html 5.49 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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <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/qfq-bs.css">
    <title>Type Ahead</title>
</head>
<body>


<label>Submit to
    <select name="submitTo" id="submitTo">
        <option>404 error</option>
        <option>save_error_matno.json</option>
        <option>save_error_geburtstag.json</option>
        <option>save_no_redirect.json</option>
        <option>save_server_redirect.json</option>
        <option>save_client_redirect.json</option>
    </select>
</label>

<label>Delete URL
    <select name="deleteUrl" id="deleteUrl">
        <option>404 error</option>
        <option>delete_client_redirect.json</option>
        <option>delete_error.json</option>
        <option>delete_no_redirect.json</option>
        <option>delete_server_redirect.json</option>
    </select>
</label>

<label>Upload to
    <select name="uploadTo" id="uploadTo">
        <option>404 error</option>
        <option>uploadhandler.php</option>
        <option>uploadhandler_error.php</option>
    </select>
</label>

<label>File Delete Url
    <select name="fileDeleteUrl" id="fileDeleteUrl">
        <option>404 error</option>
        <option>delete_file_ok.json</option>
        <option>delete_file_error.json</option>
    </select>
</label>


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

    <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>
        </div>

    </div>


    <form id="myForm" class="form-horizontal" data-toggle="validator">

        <div id="formgroup1" class="form-group">
            <div class="col-md-2">
                <label for="dropdown1" class="control-label">Text input</label>
            </div>

            <div class="col-md-6">
91
92
                <input id="dropdown1" type="text" class="form-control qfq-typeahead" name="dropdown1"
                       data-typeahead-sip="abcde" data-template="template1">
93
94
95
96
97
98
99
100
101
102
            </div>

        </div>

        <div id="formgroup2" class="form-group">
            <div class="col-md-2">
                <label for="dropdown2" class="control-label">Text input 2</label>
            </div>

            <div class="col-md-6">
103
104
                <input id="dropdown2" type="text" class="form-control qfq-typeahead" name="dropdown2"
                       data-typeahead-sip="abcdef">
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
            </div>

        </div>

    </form>
</div>

<script type="text/x-handlebars-template">

</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/EventEmitter.min.js"></script>
<script src="../js/typeahead.bundle.min.js"></script>
<script src="../js/qfq.debug.js"></script>
<script type="text/javascript">
    $(function () {
        var qfqPage = new QfqNS.QfqPage({
            tabsId: 'myTabs',
            formId: 'myForm',
            submitTo: 'api/' + $("#submitTo").val(),
            deleteUrl: 'api/' + $("#deleteUrl").val(),
            fileUploadTo: 'api/' + $("#uploadTo").val(),
            fileDeleteUrl: 'api/' + $("#fileDeleteUrl").val(),
            typeAheadUrl: 'api/typeahead.php'
        });

        $("#submitTo").on("change", function (evt) {
            qfqPage.settings.submitTo = 'api/' + $(evt.target).val();
            qfqPage.qfqForm.submitTo = 'api/' + $(evt.target).val();
        });

        $("#deleteUrl").on("change", function (evt) {
            qfqPage.settings.deleteUrl = 'api/' + $(evt.target).val();
            qfqPage.qfqForm.deleteUrl = 'api/' + $(evt.target).val();
        });

        $("#uploadTo").on("change", function (evt) {
            qfqPage.settings.fileUploadTo = 'api/' + $(evt.target).val();
            qfqPage.qfqForm.fileUploader.targetUrl = 'api/' + $(evt.target).val();
        });

        $("#fileDeleteUrl").on("change", function (evt) {
            qfqPage.settings.fileDeleteUrl = 'api/' + $(evt.target).val();
            qfqPage.qfqForm.fileDeleter.targetUrl = 'api/' + $(evt.target).val();
        });

        $('#myForm').on('invalid', function () {
            console.log("Invalid event catched");
        });

        QfqNS.Log.level = 0;
    });
</script>
</body>
</html>