zet-lib 1.5.29 → 2.0.0
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/Modal.js +85 -30
- package/lib/Model.js +118 -2
- package/lib/config_generator.js +24 -0
- package/lib/generatorApi.js +1328 -0
- package/lib/generatorApp.js +1342 -0
- package/lib/generatorModel.js +733 -0
- package/lib/lang_en.js +115 -0
- package/lib/routes/api.js +52 -0
- package/lib/routes/index.js +9 -0
- package/lib/views/error.ejs +3 -0
- package/lib/views/generatorjs.ejs +855 -852
- package/lib/views/zgenerator/bootstrap3/_form.ejs +24 -0
- package/lib/views/zgenerator/bootstrap3/create.ejs +9 -0
- package/lib/views/zgenerator/bootstrap3/createjs.ejs +3 -0
- package/lib/views/zgenerator/bootstrap3/import.ejs +52 -0
- package/lib/views/zgenerator/bootstrap3/importjs.ejs +3 -0
- package/lib/views/zgenerator/bootstrap3/index.ejs +29 -0
- package/lib/views/zgenerator/bootstrap3/indexcss.ejs +1 -0
- package/lib/views/zgenerator/bootstrap3/indexjs.ejs +307 -0
- package/lib/views/zgenerator/bootstrap3/update.ejs +8 -0
- package/lib/views/zgenerator/bootstrap3/updatejs.ejs +3 -0
- package/lib/views/zgenerator/bootstrap3/view.ejs +57 -0
- package/lib/views/zgenerator/head.ejs +12 -0
- package/lib/views/zgenerator/index.ejs +271 -0
- package/lib/views/zgenerator/indexcss.ejs +87 -0
- package/lib/views/zgenerator/indexjs.ejs +705 -0
- package/lib/views/zgenerator/layout.ejs +198 -0
- package/lib/views/zgenerator/manual_basic.ejs +2 -0
- package/lib/views/zgenerator/manual_dropdown.ejs +126 -0
- package/lib/views/zgenerator/manual_modules.ejs +192 -0
- package/lib/views/zgenerator/manual_virtual.ejs +143 -0
- package/lib/views/zgenerator/mini.ejs +341 -0
- package/lib/views/zgenerator/routerApp.ejs +359 -0
- package/lib/views/zgenerator/views/_form.ejs +25 -0
- package/lib/views/zgenerator/views/approval.ejs +42 -0
- package/lib/views/zgenerator/views/create.ejs +7 -0
- package/lib/views/zgenerator/views/createjs.ejs +16 -0
- package/lib/views/zgenerator/views/import.ejs +49 -0
- package/lib/views/zgenerator/views/importjs.ejs +4 -0
- package/lib/views/zgenerator/views/index.ejs +9 -0
- package/lib/views/zgenerator/views/indexcss.ejs +2 -0
- package/lib/views/zgenerator/views/indexjs.ejs +2 -0
- package/lib/views/zgenerator/views/preview.ejs +34 -0
- package/lib/views/zgenerator/views/update.ejs +7 -0
- package/lib/views/zgenerator/views/updatejs.ejs +16 -0
- package/lib/views/zgenerator/views/view.ejs +36 -0
- package/lib/zGeneratorRouter.js +177 -153
- package/lib/zRoute.js +14 -3
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<form id="form-group" method="post" action="" class="boxy" enctype="multipart/form-data" NO_VALI_DATE_NOVALIDATE >
|
|
2
|
+
<input type="hidden" name="_csrf" value="<%= csrfToken %>">
|
|
3
|
+
|
|
4
|
+
<div class="page-header">
|
|
5
|
+
<h3><%- titleHeader %></h3>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
/*[__GENERATE_FORM__]*/
|
|
9
|
+
|
|
10
|
+
<div class="row">
|
|
11
|
+
<div class="col-md-12">
|
|
12
|
+
<br>
|
|
13
|
+
<%- UI.Form.submit() %>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<div class="row">
|
|
18
|
+
<div class="col-md-12">
|
|
19
|
+
<br>
|
|
20
|
+
<p class="text-muted"><strong>*</strong> <%- LANGUAGE['required_not_empty'] %></p>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
</form>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<%- UI.Form.breadcrumb(frameworkcss, [{text: LANGUAGE['home'], href:"/dashboard"}, {text: LANGUAGE['grid_list'], href:"/"+routeName}, {text: LANGUAGE['create'], active: true}]) %>
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
<div class="page-header">
|
|
5
|
+
<h2><%- titleApp %></h2>
|
|
6
|
+
<small><%- companyName %></small>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<% include _form.ejs %>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<%- UI.Form.breadcrumb(frameworkcss, [{text: LANGUAGE['home'], href:"/dashboard"}, {text: LANGUAGE['grid_list'], href:"/"+routeName}, {text: LANGUAGE['form_import'], active: true}]) %>
|
|
2
|
+
|
|
3
|
+
<div class="page-header">
|
|
4
|
+
<h3><%- LANGUAGE['form_import_title']%></h3>
|
|
5
|
+
<small><%- companyName %></small>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<p> </p>
|
|
10
|
+
<form id="form-import" method="post" enctype="multipart/form-data" class="boxy">
|
|
11
|
+
|
|
12
|
+
<div class="row">
|
|
13
|
+
<div class="col-md-10">
|
|
14
|
+
<p> </p>
|
|
15
|
+
|
|
16
|
+
<div class="form-group">
|
|
17
|
+
<label class="control-label col-md-2" for="file"><%- LANGUAGE['form_label_excel_file']%></label>
|
|
18
|
+
<div class="col-md-10">
|
|
19
|
+
<input type="file" id="file" name="excel" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" class="form-control">
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<div class="row">
|
|
26
|
+
<div class="col-md-10 col-md-offset-1">
|
|
27
|
+
<button type="submit" class="btn btn-success"><%- LANGUAGE['upload']%></button>
|
|
28
|
+
<p> </p>
|
|
29
|
+
<p> </p></div>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
<div class="container">
|
|
34
|
+
<h3><%- LANGUAGE['import_results']%>:</h3>
|
|
35
|
+
<div class="results"></div>
|
|
36
|
+
<div class="row">
|
|
37
|
+
<div class="col-md-12">
|
|
38
|
+
<div class="table-responsive">
|
|
39
|
+
<table class="table table-sm table-striped" id="resultsforimport">
|
|
40
|
+
|
|
41
|
+
</table>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
</form>
|
|
48
|
+
|
|
49
|
+
<hr>
|
|
50
|
+
<div class="row">
|
|
51
|
+
<div class="col-md-10"> <%- LANGUAGE['import_example']%> : <a id="sample-parsing" href="/<%- routeName%>/sample">sample.xlsx</a></div>
|
|
52
|
+
</div>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<div class="">
|
|
2
|
+
<%- UI.Form.breadcrumb(frameworkcss, [{text: LANGUAGE['home'], href: "/dashboard"}, {
|
|
3
|
+
text: LANGUAGE['grid_list'],
|
|
4
|
+
active: true
|
|
5
|
+
}]) %>
|
|
6
|
+
|
|
7
|
+
<div class="page-header">
|
|
8
|
+
<h2><%- titleApp %></h2>
|
|
9
|
+
<small><%- companyName %></small>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<%- UI.Form.grid(frameworkcss, {
|
|
13
|
+
routeName: routeName,
|
|
14
|
+
levels: levels,
|
|
15
|
+
header: menuApp + ' ' + LANGUAGE['grid_list'],
|
|
16
|
+
gridFilters: gridFilters,
|
|
17
|
+
LANGUAGE: LANGUAGE,
|
|
18
|
+
paginationApp: paginationApp,
|
|
19
|
+
advanceSearch : advanceSearch
|
|
20
|
+
}) %>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<%- UI.Modal.grid(frameworkcss, {
|
|
25
|
+
attributeData: attributeData,
|
|
26
|
+
visibles: visibles,
|
|
27
|
+
invisibles: invisibles,
|
|
28
|
+
routeName: routeName
|
|
29
|
+
}, LANGUAGE) %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<link rel="stylesheet" href="/css/kv-html5-sortable.min.css" >
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.23.0/moment.min.js"></script>
|
|
2
|
+
<script src="/js/jquery-sortable.js"></script>
|
|
3
|
+
<script>
|
|
4
|
+
window.onerror = function (message, file, line, col, error) {
|
|
5
|
+
toastr.error(error.message, "Error occurred");
|
|
6
|
+
setTimeout(function () {
|
|
7
|
+
toastr.info("Please wait a moment while we repair.\n Please Relax", "Info");
|
|
8
|
+
ajaxDelete("/<%- routeName %>/grid",{},function (data) {
|
|
9
|
+
toastr.info("Please refresh / reload your browser.\n ", "Info");
|
|
10
|
+
});
|
|
11
|
+
}, 2500);
|
|
12
|
+
setTimeout(function () {
|
|
13
|
+
toastr.clear();
|
|
14
|
+
window.location.href = '/<%- routeName %>';
|
|
15
|
+
}, 4500);
|
|
16
|
+
return false;
|
|
17
|
+
};
|
|
18
|
+
$(function () {
|
|
19
|
+
$(".jsgrid-filter-row td").each(function () {
|
|
20
|
+
$(this).find("input[type=text]").addClass("form-search form-control form-control-sm").attr("placeholder", "search..");
|
|
21
|
+
$(this).find("input[type=number]").addClass("form-search form-control form-control-sm").attr("placeholder", "search..");
|
|
22
|
+
$(this).find("select").addClass("form-search form-control form-control-sm form-select");
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
var gridSettings = <%- JSON.stringify(gridFilters) %>;
|
|
26
|
+
var isSave = false;
|
|
27
|
+
var gridFields = {
|
|
28
|
+
no: {name: "no", title: '<%- attributeData.labels['no'] %>', width: 20},
|
|
29
|
+
/*[__GENERATE_INDEXJS__]*/
|
|
30
|
+
actionColumn: {
|
|
31
|
+
type: "control", name: "actionColumn", width: 90, editButton: false,
|
|
32
|
+
itemTemplate: function (value, item) {
|
|
33
|
+
var $result = jsGrid.fields.control.prototype.itemTemplate.apply(this, arguments);
|
|
34
|
+
var $customViewButton = $("<button>").attr({class: "btn btn-info btn-sm"}).html("<span class='fa fa-eye'></span>").click(function (e) {
|
|
35
|
+
location.href = "/<%- routeName %>/view/" + item.id;
|
|
36
|
+
e.stopPropagation();
|
|
37
|
+
});
|
|
38
|
+
var $customEditButton = $("<button>").attr({class: "btn btn-success btn-sm"}).html("<span class='fa fa-pencil'></span>").click(function (e) {
|
|
39
|
+
location.href = "/<%- routeName %>/update/" + item.id;
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
});
|
|
42
|
+
var $customDeleteButton = $("<button>").attr({class: "btn btn-danger btn-sm"}).html("<span class='fa fa-trash'></span>").click(function (e) {
|
|
43
|
+
if (window.confirm("<%- LANGUAGE['delete_confirm']%>")) {
|
|
44
|
+
ajaxDelete("/<%- routeName %>/delete",{id: item.id}, function (data) {
|
|
45
|
+
if (data.status == 0) {
|
|
46
|
+
toastr.error(data.message, data.title);
|
|
47
|
+
} else {
|
|
48
|
+
$("#jsGrid").jsGrid("loadData");
|
|
49
|
+
toastr.success(data.message, data.title);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
e.stopPropagation();
|
|
54
|
+
});
|
|
55
|
+
var div = $("<div>");
|
|
56
|
+
|
|
57
|
+
<% if(levels.view){ %>div.append($customViewButton).append(" ");<% } %>
|
|
58
|
+
<% if(levels.update){ %>div.append($customEditButton).append(" ");<% } %>
|
|
59
|
+
<% if(levels.delete) { %>div.append($customDeleteButton).append(" ");<% } %>
|
|
60
|
+
return div;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
function fixGrid() {
|
|
65
|
+
var arr = [];
|
|
66
|
+
var visibles = <%- JSON.stringify(visibles) %>;
|
|
67
|
+
for (var i = 0; i < visibles.length; i++) {
|
|
68
|
+
if(gridFields.hasOwnProperty(visibles[i])){
|
|
69
|
+
arr.push(gridFields[visibles[i]]);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return arr;
|
|
73
|
+
}
|
|
74
|
+
function saveGrid(filter,url){
|
|
75
|
+
$.ajax({
|
|
76
|
+
url:url,
|
|
77
|
+
type:"POST",
|
|
78
|
+
data:filter
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
var jsFilter = "";
|
|
82
|
+
$("#jsGrid").jsGrid({
|
|
83
|
+
width: "100%",
|
|
84
|
+
filtering: true,
|
|
85
|
+
inserting: false,
|
|
86
|
+
editing: false,
|
|
87
|
+
sorting: true,
|
|
88
|
+
autoload: true,
|
|
89
|
+
paging: true,
|
|
90
|
+
pageLoading: true,
|
|
91
|
+
css: "kv-grid-table table table-bordered table-striped kv-table-wrap",
|
|
92
|
+
pageIndex : parseInt(gridSettings.pageIndex) || 1,
|
|
93
|
+
pageSize: $("#pageSize").val(),
|
|
94
|
+
pageButtonCount: 15,
|
|
95
|
+
deleteConfirm: "<%- LANGUAGE['delete_confirm']%>",
|
|
96
|
+
controller: {
|
|
97
|
+
loadData: function (filter) {
|
|
98
|
+
var d = $.Deferred();
|
|
99
|
+
if(!isSave){
|
|
100
|
+
if(gridSettings.hasOwnProperty("pageIndex")){
|
|
101
|
+
filter = gridSettings;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return $.ajax({
|
|
105
|
+
datatype: "json",
|
|
106
|
+
type: "GET",
|
|
107
|
+
url: "/<%- routeName %>/list",
|
|
108
|
+
data: filter,
|
|
109
|
+
success: function (html) {
|
|
110
|
+
var pi = filter.pageIndex;
|
|
111
|
+
var ps = filter.pageSize;
|
|
112
|
+
var showing = "Showing <b>";
|
|
113
|
+
var pis = (pi * ps);
|
|
114
|
+
var i = ((pi - 1) * ps) + 1;
|
|
115
|
+
if (pis > html.itemsCount) pis = html.itemsCount;
|
|
116
|
+
showing += i + " - " + pis;
|
|
117
|
+
showing += "</b> of " + html.itemsCount;
|
|
118
|
+
$(".summary").html(showing);
|
|
119
|
+
$(".jsgrid-pager-container").addClass("paginaton");
|
|
120
|
+
jsFilter = filter;
|
|
121
|
+
if(isSave){
|
|
122
|
+
saveGrid(filter,"/<%- routeName %>/save");
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}).done(function (result) {
|
|
126
|
+
d.resolve($.map(result.data, function (item, itemIndex) {
|
|
127
|
+
var factor = filter.pageSize * (filter.pageIndex - 1);
|
|
128
|
+
return $.extend(item, {"no": (itemIndex + 1) + factor});
|
|
129
|
+
}));
|
|
130
|
+
});
|
|
131
|
+
},
|
|
132
|
+
updateItem: function(item) {
|
|
133
|
+
item.table = "<%- routeName %>";
|
|
134
|
+
item.model = "updateGrid";
|
|
135
|
+
return ajaxPost("/ajax",item,function (data) {
|
|
136
|
+
$("#jsGrid").jsGrid("loadData");
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
fields: fixGrid(),
|
|
141
|
+
});
|
|
142
|
+
$("#create_btn").on("click", function () {
|
|
143
|
+
location.href = "/<%- routeName %>/create";
|
|
144
|
+
});
|
|
145
|
+
$("#importExcel").on("click", function () {
|
|
146
|
+
location.href = "/<%- routeName %>/import";
|
|
147
|
+
});
|
|
148
|
+
$("#super_btn").on("click", function () {
|
|
149
|
+
location.href = "/create_fields/<%- routeName %>";
|
|
150
|
+
});
|
|
151
|
+
$(".export-xls").on("click", function () {
|
|
152
|
+
location.href = "/<%- routeName %>/excel?" + jQuery.param(jsFilter);
|
|
153
|
+
});
|
|
154
|
+
$("#backupExcel").on("click", function () {
|
|
155
|
+
location.href = "/<%- routeName %>/excel-query?" + jQuery.param(jsFilter);
|
|
156
|
+
});
|
|
157
|
+
$("#pageSize").on("change", function () {
|
|
158
|
+
$("#jsGrid").jsGrid("option", "pageSize", $(this).val());
|
|
159
|
+
// sorting grid by myField in ascending order
|
|
160
|
+
if(jsFilter.hasOwnProperty("sortField")){
|
|
161
|
+
$("#jsGrid").jsGrid("sort", jsFilter.sortField, jsFilter.sortOrder).done(function() {
|
|
162
|
+
console.log("sorting completed");
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
$(".pageSizeGrid").on("click", function () {
|
|
168
|
+
$("#jsGrid").jsGrid("option", "pageSize", $(this).data("value"));
|
|
169
|
+
$(".pageSizeGrid").removeClass("active");
|
|
170
|
+
$(this).addClass("active");
|
|
171
|
+
$("#dropdownPagination").html("Pagination "+ $(this).data("value"));
|
|
172
|
+
// sorting grid by myField in ascending order
|
|
173
|
+
if(jsFilter.hasOwnProperty("sortField")){
|
|
174
|
+
$("#jsGrid").jsGrid("sort", jsFilter.sortField, jsFilter.sortOrder).done(function() {
|
|
175
|
+
console.log("sorting completed");
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
var group = $("ul.gridsortable").sortable({
|
|
181
|
+
group: 'gridsortable',
|
|
182
|
+
isValidTarget: function ($item, container) {
|
|
183
|
+
if ($item.is(".disabled"))
|
|
184
|
+
return false;
|
|
185
|
+
else
|
|
186
|
+
return true;
|
|
187
|
+
},
|
|
188
|
+
onDrop: function ($item, container, _super) {
|
|
189
|
+
var getidname = $item.parents().attr('id');
|
|
190
|
+
if (getidname == "gridleft") {
|
|
191
|
+
$item.find('span').addClass('fa-eye').removeClass('fa-eye-slash')
|
|
192
|
+
} else {
|
|
193
|
+
$item.find('span').addClass('fa-eye-slash').removeClass('fa-eye')
|
|
194
|
+
}
|
|
195
|
+
_super($item, container);
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
$(".grid-submit").on("click", function () {
|
|
199
|
+
var leftvalue = [];
|
|
200
|
+
$("#gridleft li").each(function (i) {
|
|
201
|
+
|
|
202
|
+
var dataname = $(this).attr('data-name');
|
|
203
|
+
if (dataname != '') {
|
|
204
|
+
leftvalue.push(dataname);
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
$('#serialize_left').val(JSON.stringify(leftvalue));
|
|
208
|
+
|
|
209
|
+
var rightvalue = [];
|
|
210
|
+
|
|
211
|
+
$("#gridright li").each(function (i) {
|
|
212
|
+
var dataname = $(this).attr('data-name');
|
|
213
|
+
if (dataname != '') {
|
|
214
|
+
rightvalue.push(dataname);
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
$('#serialize_right').val(JSON.stringify(rightvalue));
|
|
218
|
+
$("#form-grid").submit();
|
|
219
|
+
});
|
|
220
|
+
$(".grid-reset").on("click", function(){
|
|
221
|
+
ajaxDelete("/<%- routeName %>/grid",{},function (data) {
|
|
222
|
+
if (data.status == 0) {
|
|
223
|
+
toastr.error(data.message, data.title);
|
|
224
|
+
} else {
|
|
225
|
+
$("#jsGrid").jsGrid("loadData");
|
|
226
|
+
toastr.success(data.message, data.title);
|
|
227
|
+
}
|
|
228
|
+
location.href = '';
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
$(".label-reset").on("click", function(){
|
|
232
|
+
ajaxDelete("/<%- routeName %>/labels",{},function (data) {
|
|
233
|
+
if (data.status == 0) {
|
|
234
|
+
toastr.error(data.message, data.title);
|
|
235
|
+
} else {
|
|
236
|
+
$("#jsGrid").jsGrid("loadData");
|
|
237
|
+
toastr.success(data.message, data.title);
|
|
238
|
+
}
|
|
239
|
+
location.href = '';
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
$(".labels-submit").on("click", function () {
|
|
243
|
+
$("#form-labels").submit();
|
|
244
|
+
});
|
|
245
|
+
$("#reloadgrid").on("click", function (e) {
|
|
246
|
+
e.preventDefault();
|
|
247
|
+
ajaxPost("/<%- routeName%>/reload",{}, function (data) {
|
|
248
|
+
location.href="/<%- routeName%>";
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
submitForm('form-grid', '', '/<%- routeName %>');
|
|
253
|
+
submitForm('form-labels', '', '/<%- routeName %>');
|
|
254
|
+
$(function () {
|
|
255
|
+
if(gridSettings.hasOwnProperty("pageSize")){
|
|
256
|
+
$("#pageSize").val(gridSettings.pageSize)
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
var gridSearchs = <%- JSON.stringify(gridSearchs)%>;
|
|
260
|
+
var searchValue = $("table.jsgrid-table > tr").eq(1).find("td");
|
|
261
|
+
<%- gridSearchs%>
|
|
262
|
+
|
|
263
|
+
isSave = true;
|
|
264
|
+
$(".form-search").on("change", function () {
|
|
265
|
+
setTimeout(function () {
|
|
266
|
+
for(var key in jsFilter) {
|
|
267
|
+
$("#"+key).val(jsFilter[key]);
|
|
268
|
+
}
|
|
269
|
+
},2000);
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
$(".form-advancesearch").on("change","input", function () {
|
|
273
|
+
advanceSearch();
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
$(".form-advancesearch").on("change","select", function () {
|
|
277
|
+
advanceSearch();
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
function advanceSearch() {
|
|
282
|
+
var arr = $(".form-advancesearch").serializeArray();
|
|
283
|
+
var o = {}
|
|
284
|
+
if(arr.length) {
|
|
285
|
+
$.each(arr, function() {
|
|
286
|
+
if (o[this.name]) {
|
|
287
|
+
if (!o[this.name].push) {
|
|
288
|
+
o[this.name] = [o[this.name]];
|
|
289
|
+
}
|
|
290
|
+
o[this.name].push(this.value || '');
|
|
291
|
+
} else {
|
|
292
|
+
o[this.name] = this.value || '';
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
var obj = {}
|
|
297
|
+
if(jsFilter.hasOwnProperty("no")) obj.no = jsFilter.no;
|
|
298
|
+
if(jsFilter.hasOwnProperty("pageIndex")) obj.pageIndex = jsFilter.pageIndex;
|
|
299
|
+
if(jsFilter.hasOwnProperty("pageSize")) obj.pageSize = jsFilter.pageSize;
|
|
300
|
+
|
|
301
|
+
jsFilter = Object.assign(obj,o);
|
|
302
|
+
console.log(JSON.stringify(jsFilter));
|
|
303
|
+
$("#jsGrid").jsGrid("search", jsFilter).done(function() {
|
|
304
|
+
console.log("filtering completed");
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
</script>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<%- UI.Form.breadcrumb(frameworkcss, [{text: LANGUAGE['home'], href:"/dashboard"}, {text: LANGUAGE['grid_list'], href:"/"+routeName}, {text: LANGUAGE['update'], active: true}]) %>
|
|
2
|
+
|
|
3
|
+
<div class="page-header">
|
|
4
|
+
<h2><%- titleApp %></h2>
|
|
5
|
+
<small><%- companyName %></small>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<% include _form.ejs %>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<%- UI.Form.breadcrumb(frameworkcss, [{text: LANGUAGE['home'], href:"/dashboard"}, {text: LANGUAGE['grid_list'], href:"/"+routeName}, {text: LANGUAGE['update'], href : '/' + routeName+'/update/'+data.id}, {text: LANGUAGE['create'], href : '/'+routeName+'/create'}, {text: LANGUAGE['view'], active : true}]) %>
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
<div class="page-header">
|
|
5
|
+
<h2><%- titleApp %></h2>
|
|
6
|
+
<small><%- companyName %></small>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<div class="row">
|
|
10
|
+
<div class="col-md-6">
|
|
11
|
+
<div class="page-title"><h3><%- menuApp %> <%= data.///COLUMN_COMMON/// %></h3></div>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="col-md-6">
|
|
14
|
+
<div class="btn-group <%- UI.Form.pullRight(frameworkcss)%>" role="group" aria-label="button">
|
|
15
|
+
<% if(levels.update){ %>
|
|
16
|
+
<a class="btn btn-info btn-rounded dimens2x" href="/<%- routeName%>/update/<%= data.id %>"
|
|
17
|
+
title="Update data"><i class="fa fa-pencil"></i> <%- LANGUAGE['update']%>
|
|
18
|
+
</a>
|
|
19
|
+
<% } %>
|
|
20
|
+
<% if(levels.delete){ %>
|
|
21
|
+
<button class="btn btn-danger btn-rounded dimens2x" id="<%- routeName %>-delete" data-id="<%= data.id %>"
|
|
22
|
+
title="Delete Data"><i class="fa fa-trash"></i> <%- LANGUAGE['delete'] %>
|
|
23
|
+
</button>
|
|
24
|
+
|
|
25
|
+
<% } %>
|
|
26
|
+
<% if(levels.create){ %>
|
|
27
|
+
<a class="btn btn-success" href="/<%- routeName%>/create" title="Create data"><i class="fa fa-plus"></i>
|
|
28
|
+
<%- LANGUAGE['create']%>
|
|
29
|
+
</a>
|
|
30
|
+
<% } %>
|
|
31
|
+
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<script>
|
|
37
|
+
document.getElementById("<%- routeName %>-delete").addEventListener("click", deleteData);
|
|
38
|
+
function deleteData() {
|
|
39
|
+
if (window.confirm("<%- LANGUAGE['delete_confirm'] %>")) {
|
|
40
|
+
var http = new XMLHttpRequest();
|
|
41
|
+
var url = '/<%- routeName %>/delete';
|
|
42
|
+
var params = 'id=<%- data.id%>';
|
|
43
|
+
http.open('DELETE', url, true);
|
|
44
|
+
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
|
|
45
|
+
http.onreadystatechange = function () {//Call a function when the state changes.
|
|
46
|
+
if (http.readyState == 4 && http.status == 200) {
|
|
47
|
+
location.href = "/<%- routeName%>"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
http.send(params);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
</script>
|
|
54
|
+
<p> </p>
|
|
55
|
+
<div class="boxy">
|
|
56
|
+
/*[__GENERATE_VIEWJS__]*/
|
|
57
|
+
</div>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<meta charset="utf-8">
|
|
2
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
3
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
4
|
+
<meta name="usertoken" content="<%- token %>"/>
|
|
5
|
+
<meta name="socketUrl" content="<%- socketUrl %>"/>
|
|
6
|
+
<meta name="csrf-token" content="<%- csrfToken %>">
|
|
7
|
+
<title><%- menuApp %></title>
|
|
8
|
+
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css">
|
|
9
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
|
10
|
+
<%- moduleHead %>
|
|
11
|
+
<link rel='stylesheet' href='/css/app.css'/>
|
|
12
|
+
<%- renderHead ? include("./../"+renderHead) : "" %>
|