-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
595 lines (584 loc) · 20.9 KB
/
index.html
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
100
101
102
103
104
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
164
165
166
167
168
169
170
171
172
173
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, user-scalable=no">
<title>Editor example - Basic initialisation</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.22/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.6.5/css/buttons.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/select/1.3.1/css/select.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://editor-datatables.s3-us-west-2.amazonaws.com/public/css/editor.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://editor-datatables.s3-us-west-2.amazonaws.com/examples/resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="https://editor-datatables.s3-us-west-2.amazonaws.com/examples/resources/demo.css">
<style type="text/css" class="init">
</style>
<script type="text/javascript" language="javascript" src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/1.10.22/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/buttons/1.6.5/js/dataTables.buttons.min.js"></script>
<script type="text/javascript" language="javascript" src="https://cdn.datatables.net/select/1.3.1/js/dataTables.select.min.js"></script>
<script type="text/javascript" language="javascript" src="https://editor-datatables.s3-us-west-2.amazonaws.com/public/js/dataTables.editor.min.js"></script>
<script type="text/javascript" language="javascript" src="https://editor-datatables.s3-us-west-2.amazonaws.com/examples/resources/syntax/shCore.js"></script>
<script type="text/javascript" language="javascript" src="https://editor-datatables.s3-us-west-2.amazonaws.com/examples/resources/demo.js"></script>
<script type="text/javascript" language="javascript" src="https://editor-datatables.s3-us-west-2.amazonaws.com/examples/resources/editor-demo.js"></script>
<script type="text/javascript" language="javascript" class="init">
var editor; // use a global for the submit and return data rendering in the examples
$(document).ready(function() {
editor = new $.fn.dataTable.Editor( {
ajax: "https://k6e5ozz9yl.execute-api.us-west-2.amazonaws.com/dev/items",
table: "#example",
fields: [ {
label: "First name:",
name: "first_name"
}, {
label: "Last name:",
name: "last_name"
}, {
label: "Position:",
name: "position"
}, {
label: "Office:",
name: "office"
}, {
label: "Extension:",
name: "extn"
}, {
label: "Start date:",
name: "start_date",
type: "datetime"
}, {
label: "Salary:",
name: "salary"
}
]
} );
$('#example').DataTable( {
dom: "Bfrtip",
ajax: "https://k6e5ozz9yl.execute-api.us-west-2.amazonaws.com/dev/items",
columns: [
{ data: null, render: function ( data, type, row ) {
// Combine the first and last names into a single table field
return data.first_name+' '+data.last_name;
} },
{ data: "position" },
{ data: "office" },
{ data: "extn" },
{ data: "start_date" },
{ data: "salary", render: $.fn.dataTable.render.number( ',', '.', 0, '$' ) }
],
select: true,
buttons: [
{ extend: "create", editor: editor },
{ extend: "edit", editor: editor },
{ extend: "remove", editor: editor }
]
} );
} );
</script>
</head>
<body class="dt-example node">
<div class="container">
<section>
<h1>Editor example <span>Basic initialisation</span></h1>
<div class="info">
<p><a href="//editor.datatables.net">Editor</a> is a Create, Read, Update and Delete (CRUD) extension for <a href="//datatables.net">DataTables</a> that provides
the ability to easily add, edit and delete rows on a database that is displayed by a DataTable. Editor provides a clean and responsive interface for end user
manipulation of data, an expressive API for complete control and a well defined server communications protocol for data submission.</p>
<p>This simple example shows a table with seven fields, each of which can be edited as plain text. In other examples we will explore how to add date pickers,
<code class="tag" title="HTML tag">select</code> elements and other controls to make form input intuitive for the system user, among many other aspects of the
Editor API.</p>
</div>
<div class="demo-html">
<table id="example" class="display" style="width:100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Extn.</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Extn.</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
</table>
</div>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">var editor; // use a global for the submit and return data rendering in the examples
$(document).ready(function() {
editor = new $.fn.dataTable.Editor( {
ajax: "/api/staff",
table: "#example",
fields: [ {
label: "First name:",
name: "first_name"
}, {
label: "Last name:",
name: "last_name"
}, {
label: "Position:",
name: "position"
}, {
label: "Office:",
name: "office"
}, {
label: "Extension:",
name: "extn"
}, {
label: "Start date:",
name: "start_date",
type: "datetime"
}, {
label: "Salary:",
name: "salary"
}
]
} );
$('#example').DataTable( {
dom: "Bfrtip",
ajax: "/api/staff",
columns: [
{ data: null, render: function ( data, type, row ) {
// Combine the first and last names into a single table field
return data.first_name+' '+data.last_name;
} },
{ data: "position" },
{ data: "office" },
{ data: "extn" },
{ data: "start_date" },
{ data: "salary", render: $.fn.dataTable.render.number( ',', '.', 0, '$' ) }
],
select: true,
buttons: [
{ extend: "create", editor: editor },
{ extend: "edit", editor: editor },
{ extend: "remove", editor: editor }
]
} );
} );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
<ul>
<li>
<a href="https://code.jquery.com/jquery-3.5.1.js">https://code.jquery.com/jquery-3.5.1.js</a>
</li>
<li>
<a href="https://cdn.datatables.net/1.10.22/js/jquery.dataTables.min.js">https://cdn.datatables.net/1.10.22/js/jquery.dataTables.min.js</a>
</li>
<li>
<a href=
"https://cdn.datatables.net/buttons/1.6.5/js/dataTables.buttons.min.js">https://cdn.datatables.net/buttons/1.6.5/js/dataTables.buttons.min.js</a>
</li>
<li>
<a href="https://cdn.datatables.net/select/1.3.1/js/dataTables.select.min.js">https://cdn.datatables.net/select/1.3.1/js/dataTables.select.min.js</a>
</li>
<li>
<a href="../../js/dataTables.editor.min.js">../../js/dataTables.editor.min.js</a>
</li>
</ul>
</div>
<div class="table">
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
</div>
<div class="css">
<div>
<p>This example uses a little bit of additional CSS beyond what is loaded from the library files (below), in order to correctly display the table. The
additional CSS used is shown below:</p><code class="multiline language-css"></code>
</div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
<ul>
<li>
<a href="https://cdn.datatables.net/1.10.22/css/jquery.dataTables.min.css">https://cdn.datatables.net/1.10.22/css/jquery.dataTables.min.css</a>
</li>
<li>
<a href=
"https://cdn.datatables.net/buttons/1.6.5/css/buttons.dataTables.min.css">https://cdn.datatables.net/buttons/1.6.5/css/buttons.dataTables.min.css</a>
</li>
<li>
<a href=
"https://cdn.datatables.net/select/1.3.1/css/select.dataTables.min.css">https://cdn.datatables.net/select/1.3.1/css/select.dataTables.min.css</a>
</li>
<li>
<a href="../../css/editor.dataTables.min.css">../../css/editor.dataTables.min.css</a>
</li>
</ul>
</div>
<div class="ajax">
<p>This table loads data by Ajax. The latest data that has been loaded is shown below. This data will update automatically as any additional data is
loaded.</p>
</div>
<div class="php">
<p>The script used to perform the server-side processing for this table is shown below. Please note that this is just an example script using PHP. Server-side
processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables
documentation</a>.</p>
</div>
</div>
</section>
</div>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="./index.html">Simple initialisation</a></h3>
<ul class="toc active">
<li class="active">
<a href="./simple.html">Basic initialisation</a>
</li>
<li>
<a href="./multiRow.html">Multi-row editing</a>
</li>
<li>
<a href="./fieldTypes.html">Field types</a>
</li>
<li>
<a href="./fieldDefaults.html">Setting defaults</a>
</li>
<li>
<a href="./noAjax.html">Local table editing</a>
</li>
<li>
<a href="./i18n.html">Internationalisation</a>
</li>
<li>
<a href="./inTableControls.html">In table form controls</a>
</li>
<li>
<a href="./server-side-processing.html">Server-side processing</a>
</li>
<li>
<a href="./template.html">Custom form layout / templates (tags)</a>
</li>
<li>
<a href="./template-attribute.html">Custom form layout / templates (attributes)</a>
</li>
<li>
<a href="./join.html">Join tables - working with multiple SQL tables</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../advanced/index.html">Advanced initialisation</a></h3>
<ul class="toc">
<li>
<a href="../advanced/formOnlyData.html">Data shown only in the form</a>
</li>
<li>
<a href="../advanced/tableOnlyData.html">Data shown in table only</a>
</li>
<li>
<a href="../advanced/multiItem.html">Multi-item editing (rows, columns, cells)</a>
</li>
<li>
<a href="../advanced/REST.html">REST interface</a>
</li>
<li>
<a href="../advanced/deepObjects.html">Complex (nested) JSON data source</a>
</li>
<li>
<a href="../advanced/localstorage.html">Ajax override - using localStorage for the data source</a>
</li>
<li>
<a href="../advanced/jsonId.html">Row ID source specification</a>
</li>
<li>
<a href="../advanced/compoundKey.html">Compound database primary key</a>
</li>
<li>
<a href="../advanced/htmlTable.html">DOM sourced table</a>
</li>
<li>
<a href="../advanced/sqlView.html">SQL VIEW</a>
</li>
<li>
<a href="../advanced/joinSelf.html">Join tables - self referencing join</a>
</li>
<li>
<a href="../advanced/joinLinkTable.html">Join tables - link table</a>
</li>
<li>
<a href="../advanced/joinArray.html">Join tables - one-to-many join</a>
</li>
<li>
<a href="../advanced/parentChild.html">Parent child editor</a>
</li>
<li>
<a href="../advanced/upload.html">File upload</a>
</li>
<li>
<a href="../advanced/upload-many.html">File upload (many)</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../extensions/index.html">DataTables extensions</a></h3>
<ul class="toc">
<li>
<a href="../extensions/keyTable.html">Excel like keyboard navigation</a>
</li>
<li>
<a href="../extensions/autoFill.html">Excel like AutoFill feature</a>
</li>
<li>
<a href="../extensions/excel.html">AutoFill and KeyTable together</a>
</li>
<li>
<a href="../extensions/import.html">CSV import</a>
</li>
<li>
<a href="../extensions/exportButtons.html">Export buttons</a>
</li>
<li>
<a href="../extensions/responsive.html">Responsive table extension</a>
</li>
<li>
<a href="../extensions/rowReorder.html">Row reordering</a>
</li>
<li>
<a href="../extensions/searchPanes.html">SearchPanes Integration for Editor</a>
</li>
<li>
<a href="../extensions/searchPanesCascade.html">SearchPanes Integration for Editor with CascadePanes</a>
</li>
<li>
<a href="../extensions/searchPanesViewTotal.html">SearchPanes Integration for Editor with ViewTotal</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../dates/index.html">Dates and time</a></h3>
<ul class="toc">
<li>
<a href="../dates/dates.html">Date picker</a>
</li>
<li>
<a href="../dates/formatting.html">Formatted dates (server-side)</a>
</li>
<li>
<a href="../dates/formatting-client.html">Formatted dates (client-side)</a>
</li>
<li>
<a href="../dates/datetime.html">Date and time input</a>
</li>
<li>
<a href="../dates/time.html">Time inputs</a>
</li>
<li>
<a href="../dates/time-increment.html">Time increment options</a>
</li>
<li>
<a href="../dates/options-min-max.html">Options - min and max dates</a>
</li>
<li>
<a href="../dates/options-week-numbers.html">Options - week numbers</a>
</li>
<li>
<a href="../dates/options-disable-days.html">Options - disable days</a>
</li>
<li>
<a href="../dates/i18n.html">Internationalisation</a>
</li>
<li>
<a href="../dates/jqueryui.html">jQuery UI DatePicker</a>
</li>
<li>
<a href="../dates/jqueryui-formatting.html">jQuery UI DatePicker with custom formatting</a>
</li>
<li>
<a href="../dates/html5.html">HTML5 date input</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../inline-editing/index.html">Inline editing</a></h3>
<ul class="toc">
<li>
<a href="../inline-editing/simple.html">Simple inline editing</a>
</li>
<li>
<a href="../inline-editing/tabControl.html">Tab between columns</a>
</li>
<li>
<a href="../inline-editing/options.html">Editing options - submit on blur</a>
</li>
<li>
<a href="../inline-editing/submitData.html">Editing options - submit full row data</a>
</li>
<li>
<a href="../inline-editing/submitButton.html">Inline editing with a submit button</a>
</li>
<li>
<a href="../inline-editing/editIcon.html">Edit icon</a>
</li>
<li>
<a href="../inline-editing/join.html">Joined tables</a>
</li>
<li>
<a href="../inline-editing/responsive.html">Responsive integration</a>
</li>
<li>
<a href="../inline-editing/columns.html">Selected columns only</a>
</li>
<li>
<a href="../inline-editing/fixedcolumns.html">FixedColumns integration</a>
</li>
<li>
<a href="../inline-editing/serverSide.html">Server-side processing</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../bubble-editing/index.html">Bubble editing</a></h3>
<ul class="toc">
<li>
<a href="../bubble-editing/simple.html">Simple bubble editing</a>
</li>
<li>
<a href="../bubble-editing/grouped.html">Multiple fields in a bubble</a>
</li>
<li>
<a href="../bubble-editing/options.html">Form control and display options</a>
</li>
<li>
<a href="../bubble-editing/defaultOptions.html">Default control and display options</a>
</li>
<li>
<a href="../bubble-editing/inTableControls.html">Bubble editing with in table row controls</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../api/index.html">API</a></h3>
<ul class="toc">
<li>
<a href="../api/confirmClose.html">Events - unsaved changes close confirmation</a>
</li>
<li>
<a href="../api/dependentFields.html">Dependent fields</a>
</li>
<li>
<a href="../api/clientValidation.html">Client-side validation</a>
</li>
<li>
<a href="../api/triggerButton.html">Customised control buttons</a>
</li>
<li>
<a href="../api/backNext.html">Previous / next editing buttons</a>
</li>
<li>
<a href="../api/cancelButton.html">Cancel button</a>
</li>
<li>
<a href="../api/checkbox.html">Always shown checkbox</a>
</li>
<li>
<a href="../api/softDelete.html">Soft delete</a>
</li>
<li>
<a href="../api/duplicateButton.html">Duplicate button</a>
</li>
<li>
<a href="../api/removeMessage.html">Custom delete / remove message</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../standalone/index.html">Standalone</a></h3>
<ul class="toc">
<li>
<a href="../standalone/simple.html">Simple standalone editing</a>
</li>
<li>
<a href="../standalone/bubble.html">Bubble editing</a>
</li>
<li>
<a href="../standalone/inline.html">Inline editing</a>
</li>
<li>
<a href="../standalone/collection.html">Standalone collection editor</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../styling/index.html">Styling</a></h3>
<ul class="toc">
<li>
<a href="../styling/bootstrap.html">Bootstrap 3</a>
</li>
<li>
<a href="../styling/bootstrap4.html">Bootstrap 4</a>
</li>
<li>
<a href="../styling/foundation.html">Foundation</a>
</li>
<li>
<a href="../styling/semanticui.html">Semantic UI</a>
</li>
<li>
<a href="../styling/jqueryui.html">jQuery UI</a>
</li>
<li>
<a href="../styling/fieldDisplay.html">Field display styling options</a>
</li>
<li>
<a href="../styling/columns.html">Multi-column layout</a>
</li>
<li>
<a href="../styling/large.html">Large window layout</a>
</li>
<li>
<a href="../styling/stackedInputs.html">Stacked inputs</a>
</li>
<li>
<a href="../styling/envelope.html">Envelope display controller</a>
</li>
<li>
<a href="../styling/envelopeInTable.html">Envelope display with in table controls</a>
</li>
<li>
<a href="../styling/template.html">Custom form layout / templates</a>
</li>
</ul>
</div>
<div class="toc-group">
<h3><a href="../plug-ins/index.html">Plug-ins</a></h3>
<ul class="toc">
<li>
<a href="../plug-ins/fieldPlugin.html">Custom field type plug-ins</a>
</li>
<li>
<a href="../plug-ins/displayController.html">Custom display controller</a>
</li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
"http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
<p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2020<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html>