forked from joaool/MotherGithub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_datatables6.html
205 lines (188 loc) · 5.92 KB
/
test_datatables6.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
<!--
* http://download.dojotoolkit.org/release-1.2.3/dojo-release-1.2.3/dojox/form/tests/test_BusyButton.html
* http://www.sitepen.com/blog/2008/10/17/dojo-building-blocks-of-the-web/
*
* <!DOCTYPE html>
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<script type="text/javascript" src="Dojo Toolkit/dojo-release-1.7.1/dojo/dojo.js" djconfig="parseOnLoad: true, isDebug: true" >
</script>
<link href="Dojo Toolkit/dojo-release-1.7.1/dijit/themes/claro/claro.css" rel="stylesheet">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-->
<!-- -->
<!-- -->
<title>Test datatables v6.0</title>
<script>
dojoConfig= {
has: {
"dojo-firebug": true
},
parseOnLoad: false,
debugAtAllCosts: true,
foo: "bar",
async: true
};
</script>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="//datatables.net/download/build/nightly/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8" src="../DataTables_Editor/media/js/dataTables.editor.js" ></script>
<!--
<script src="//datatables.net/release-datatables/examples/examples_support/jquery.jeditable.js"></script>
-->
<script type="text/javascript" language="javascript" src="../ColReorder-1.1.0/js/dataTables.colReorder.js"></script>
<script src="//cdn.datatables.net/plug-ins/505bef35b56/integration/bootstrap/3/dataTables.bootstrap.js"></script>
<script type="text/javascript" src="../dojo1.9.2/dojo/dojo.js"></script>
<link rel="stylesheet" type="text/css" href="../bootstrap-3.1.1-dist/css/bootstrap.css">
<link rel="stylesheet" href="../Jcrop/demos/demo_files/main.css" type="text/css" />
<link href="../dojo1.9.2/dijit/themes/claro/claro.css" rel="stylesheet">
<link href="../DataTables 1.10.0-beta.2/media/css/jquery.dataTables.css" rel="stylesheet" type="text/css" />
<link href="../DataTables_Editor/media/css/dataTables.editor.css" rel="stylesheet" type="text/css" />
<!--- For Mother Builder -->
<link rel="stylesheet" type="text/css" href="Mother/MotherBuilder.css" />
<style type="text/css">
div.container {
min-width: 980px;
margin: 0 auto;
}
div.dataTables_length label {
width: 460px;
float: left;
text-align: left;
}
div.dataTables_length select {
width: 75px;
}
div.dataTables_filter label {
float: right;
width: 460px;
}
div.dataTables_info {
padding-top: 8px;
}
div.dataTables_paginate {
float: right;
margin: 0;
}
table {
margin: 1em 0;
clear: both;
}
</style>
<script>
oDbg=null;//so that we can use "this" inside this html with embedded script
// define.amd.jQuery = true;
require([
"dojo/query",
"dojo/dom",
"dojo/dom-construct",
"dijit/registry",
"Mother/areasFactory.js",
"Mother/textbox.js",
"Mother/numberbox.js",
"Mother/container.js",
],
function(query,dom,domConstruct,registry,canvas,textbox,numberbox,container){
console.log("Inicio");
console.log("--------------------------------------- container done.... -----------------------------------------------");
// $(document).ready( function () {
editor = new $.fn.dataTable.Editor( {
"ajaxUrl": "http://localhost:3000/dtTableCRUD",
"domTable": "#example",
"fields": [
{
"label": "Name do Gajo:",
"name": "name"
}, {
"label": "Position:",
"name": "position"
}, {
"label": "Salary:",
"name": "salary"
}, {
"label": "Start date:",
"name": "start_date"
}, {
"label": "Office:",
"name": "office"
}, {
"label": "Phone:",
"name": "extn"
}
]
} );
$('#example').dataTable( {
"sDom": "Tfrtip",
"sAjaxSource": "http://localhost:3000/dtTable",
"aoColumns": [
{ "mDataProp": "name", "sTitle":"Name do Gajo" },
{ "mDataProp": "position", "sTitle":"Position" },
{ "mDataProp": "salary", "sTitle":"Salary" },
{ "mDataProp": "start_date", "sTitle":"Start date" },
{ "mDataProp": "office" , "sTitle":"Office" },
{ "mDataProp": "extn", "sTitle":"Phone" },
{
"mDataProp": null,
"sClass": "center",
"sDefaultContent": '<a href="" class="editor_edit">Edit</a>',
"bSortable": false,
"bSearchable": false
},
{
"mDataProp": null,
"sClass": "center",
"sDefaultContent": '<a href="" class="editor_remove">Delete</a>',
"bSortable": false,
"bSearchable": false
}
]
} );
$('button.editor_create').on('click', function (e) {
e.preventDefault();
editor.create(
'Create new record',
{
"label": "Add",
"fn": function () {
editor.submit()
}
}
);
} );
$('#example').on('click', 'a.editor_edit', function (e) {
e.preventDefault();
editor.edit(
$(this).parents('tr')[0],
'Edit record',
{
"label": "Update",
"fn": function () { editor.submit(); }
}
);
} );
console.log(document.title+"...... END..");
}//closing of main function
);//closing of require function
</script>
</head>
<body class="claro Mother">
<p id="target">
<b style="display:block; padding: .5em 1em;">
FrameLink using a JQuery grid.
</b>
</p>
<div class="container">
<button class="editor_create">Create new record</button>
<!--
<table id="example" class="display" width="100%">
-->
<table id="example" class="table table-striped table-bordered" cellspacing="0" width="100%">
<tbody>
</tbody>
</table>
</div>
</body>
</html>