zet-lib 1.0.18 → 1.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +3 -6
- package/lib/zdataTable.js +12 -5
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -5,15 +5,13 @@ module.exports = {
|
|
|
5
5
|
Util: require('./Util'),
|
|
6
6
|
myCache: require('./cache'),
|
|
7
7
|
connection: require('./connection'),
|
|
8
|
-
|
|
8
|
+
zDataTable: require('./zdataTable'),
|
|
9
9
|
zDebug: require('./debug'),
|
|
10
10
|
zForm: require('./Form'),
|
|
11
11
|
io: require('./io'),
|
|
12
12
|
zMail: require('./Mail'),
|
|
13
|
-
zModal: require('./Modal'),
|
|
14
13
|
moduleLib: require('./moduleLib'),
|
|
15
|
-
|
|
16
|
-
zapp: require('./zapp'),
|
|
14
|
+
zApp: require('./zapp'),
|
|
17
15
|
zComponent: require('./zComponent'),
|
|
18
16
|
zFn: require('./zFn'),
|
|
19
17
|
zFunction: require('./zFunction'),
|
|
@@ -24,6 +22,5 @@ module.exports = {
|
|
|
24
22
|
zRoleRouter : require('./zRoleRouter'),
|
|
25
23
|
zPage: require('./zPage'),
|
|
26
24
|
zTester: require('./zTester'),
|
|
27
|
-
zCache : require('./zCache')
|
|
28
|
-
UI : require('./UI')
|
|
25
|
+
zCache : require('./zCache')
|
|
29
26
|
};
|
package/lib/zdataTable.js
CHANGED
|
@@ -33,11 +33,20 @@ class dataTable {
|
|
|
33
33
|
return this.setColumns;
|
|
34
34
|
let html = '';
|
|
35
35
|
for (var key in this.visibles) {
|
|
36
|
-
html += `<th id="data_${key}">${this.visibles[key]}</th>`;
|
|
36
|
+
html += `<th id="data_${key}_label">${this.visibles[key]}</th>`;
|
|
37
37
|
}
|
|
38
38
|
return html;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
get columnsFilter() {
|
|
42
|
+
let html = '<tr class="filters">';
|
|
43
|
+
for (var key in this.visibles) {
|
|
44
|
+
html += `<th id="data_${key}">${this.searchColumns[key]}</th>`;
|
|
45
|
+
}
|
|
46
|
+
html += '</tr>';
|
|
47
|
+
return html;
|
|
48
|
+
}
|
|
49
|
+
|
|
41
50
|
/*
|
|
42
51
|
Create table html header
|
|
43
52
|
*/
|
|
@@ -45,7 +54,7 @@ class dataTable {
|
|
|
45
54
|
if (this.setTable)
|
|
46
55
|
return this.setTable;
|
|
47
56
|
return `<table id="dataTable" class="display table table-hover table-responsive" style="width:100%">
|
|
48
|
-
<thead>${this.columns}</thead>
|
|
57
|
+
<thead>${this.columns} ${this.columnsFilter}</thead>
|
|
49
58
|
</table>`;
|
|
50
59
|
}
|
|
51
60
|
|
|
@@ -113,13 +122,11 @@ class dataTable {
|
|
|
113
122
|
get scripts() {
|
|
114
123
|
let script = '<script type="text/javascript" src="https://cdn.datatables.net/v/bs5/dt-1.11.3/date-1.1.1/fc-4.0.1/fh-3.2.1/r-2.2.9/rg-1.1.4/sc-2.0.5/sl-1.3.4/datatables.min.js"></script>';
|
|
115
124
|
script += `<script>${Util.newLine}`;
|
|
116
|
-
script += `var dataTableFilters = ${JSON.stringify(this.searchColumns)};${Util.newLine}`;
|
|
117
125
|
script += `var dataTableFields = ${JSON.stringify(Object.keys(this.visibles,null,2))};${Util.newLine}`;
|
|
118
126
|
script += `var dataTableTypes = ${JSON.stringify(this.types,null,2)};${Util.newLine}`;
|
|
119
127
|
script += `var dataTableRoute = "${this.routeName}";${Util.newLine}`;
|
|
120
128
|
script += `</script>${Util.newLine}`;
|
|
121
|
-
script += `<script type="text/javascript" src="/js/
|
|
122
|
-
|
|
129
|
+
script += `<script type="text/javascript" src="/js/datatable.js"></script>${Util.newLine}`;
|
|
123
130
|
if (this.searchColumns.FILTERKEY) {
|
|
124
131
|
script += `<script>$(function () { setTimeout(function () { ${this.searchColumns.FILTERKEY} },500) });</script>${Util.newLine}`;
|
|
125
132
|
}
|