aboutsummaryrefslogtreecommitdiffstats
path: root/dbdocs/tables/table.js
blob: a07a96e732372511ffc35e8b2befe21a990b959d (plain) (blame)
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
$(document).ready(function() {
    anchors.options.visible = 'always';
    anchors.add('h3');

    var table = $('#standard_table').DataTable( {
        lengthChange: false,
        ordering: false,
        paging: config.pagination,
		autoWidth: true,
		buttons: [
					{
						text: 'Related columns',
						action: function ( e, dt, node, config ) {
							$(".relatedKey").toggle();
							this.active( !this.active() );
							table.columns.adjust().draw();
						}
					},
					{
						text: 'Constraint',
						action: function ( e, dt, node, config ) {
							$(".constraint").toggle();
							this.active( !this.active() );
							table.columns.adjust().draw();
						}
					},
					{
						extend: 'columnsToggle',
						columns: '.toggle'
					}
				]

    } );
    dataTableExportButtons(table);

    if ($('#indexes_table').length) {
        var indexes = $('#indexes_table').DataTable({
            lengthChange: false,
            paging: config.pagination,
            ordering: false
        });
        dataTableExportButtons(indexes);
    }

    if ($('#check_table').length) {
        var check = $('#check_table').DataTable( {
            lengthChange: false,
            paging: config.pagination,
            ordering: false
        } );
        dataTableExportButtons(check);
    }
} );


$(function() {
	var $imgs = $('img.diagram, object.diagram');
	$imgs.css("cursor", "move")
	$imgs.draggable();
});

$.fn.digits = function(){
	return this.each(function(){
		$(this).text( $(this).text().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "1 ") );
	})
}

$(function() {
	$("#recordNumber").digits();
});

var codeElement = document.getElementById("sql-script-codemirror");
var editor = null;
if (null != codeElement) {
	editor = CodeMirror.fromTextArea(codeElement, {
		lineNumbers: true,
		mode: 'text/x-sql',
		indentWithTabs: true,
		smartIndent: true,
		lineNumbers: true,
		matchBrackets: true,
		autofocus: true,
        readOnly: true
	});
}