jqwidgets-ng 22.0.0 → 22.0.2
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/jqwidgets/jqx-all.js +106 -3335
- package/jqwidgets/jqxbarcode.js +14 -0
- package/jqwidgets/jqxcheckboxgroup.js +14 -0
- package/jqwidgets/jqxcore.js +1 -1
- package/jqwidgets/jqxgrid.export.js +1 -831
- package/jqwidgets/jqxqrcode.js +14 -0
- package/jqwidgets/jqxradiobuttongroup.js +14 -0
- package/jqwidgets/jqxsplitlayout.js +1 -2456
- package/jqwidgets/modules/jqxbarcode.js +34 -14
- package/jqwidgets/modules/jqxbargauge.js +36 -16
- package/jqwidgets/modules/jqxbulletchart.js +38 -18
- package/jqwidgets/modules/jqxbuttongroup.js +36 -16
- package/jqwidgets/modules/jqxbuttons.js +34 -14
- package/jqwidgets/modules/jqxcalendar.js +40 -20
- package/jqwidgets/modules/jqxchart.js +48 -28
- package/jqwidgets/modules/jqxcheckbox.js +38 -18
- package/jqwidgets/modules/jqxcheckboxgroup.js +38 -18
- package/jqwidgets/modules/jqxcolorpicker.js +40 -20
- package/jqwidgets/modules/jqxcombobox.js +44 -24
- package/jqwidgets/modules/jqxcomplexinput.js +36 -16
- package/jqwidgets/modules/jqxdatatable.js +64 -44
- package/jqwidgets/modules/jqxdatetimeinput.js +58 -38
- package/jqwidgets/modules/jqxdocking.js +38 -18
- package/jqwidgets/modules/jqxdockinglayout.js +46 -26
- package/jqwidgets/modules/jqxdockpanel.js +36 -16
- package/jqwidgets/modules/jqxdragdrop.js +38 -18
- package/jqwidgets/modules/jqxdraw.js +34 -14
- package/jqwidgets/modules/jqxdropdownbutton.js +36 -16
- package/jqwidgets/modules/jqxdropdownlist.js +56 -36
- package/jqwidgets/modules/jqxeditor.js +68 -48
- package/jqwidgets/modules/jqxexpander.js +42 -22
- package/jqwidgets/modules/jqxfileupload.js +38 -18
- package/jqwidgets/modules/jqxform.js +66 -46
- package/jqwidgets/modules/jqxformattedinput.js +58 -38
- package/jqwidgets/modules/jqxgantt.js +36 -16
- package/jqwidgets/modules/jqxgauge.js +40 -20
- package/jqwidgets/modules/jqxgrid.js +90 -70
- package/jqwidgets/modules/jqxheatmap.js +36 -16
- package/jqwidgets/modules/jqxinput.js +38 -18
- package/jqwidgets/modules/jqxkanban.js +68 -48
- package/jqwidgets/modules/jqxknob.js +38 -18
- package/jqwidgets/modules/jqxlayout.js +46 -26
- package/jqwidgets/modules/jqxlineargauge.js +40 -20
- package/jqwidgets/modules/jqxlinkbutton.js +34 -14
- package/jqwidgets/modules/jqxlistbox.js +48 -28
- package/jqwidgets/modules/jqxlistmenu.js +64 -44
- package/jqwidgets/modules/jqxloader.js +34 -14
- package/jqwidgets/modules/jqxmaskedinput.js +34 -14
- package/jqwidgets/modules/jqxmenu.js +46 -26
- package/jqwidgets/modules/jqxnavbar.js +42 -22
- package/jqwidgets/modules/jqxnavigationbar.js +50 -30
- package/jqwidgets/modules/jqxnotification.js +42 -22
- package/jqwidgets/modules/jqxnumberinput.js +48 -28
- package/jqwidgets/modules/jqxpanel.js +40 -20
- package/jqwidgets/modules/jqxpasswordinput.js +42 -22
- package/jqwidgets/modules/jqxpivotdesigner.js +72 -52
- package/jqwidgets/modules/jqxpivotgrid.js +72 -52
- package/jqwidgets/modules/jqxpopover.js +36 -16
- package/jqwidgets/modules/jqxprogressbar.js +34 -14
- package/jqwidgets/modules/jqxqrcode.js +42 -22
- package/jqwidgets/modules/jqxradiobutongroup.js +38 -18
- package/jqwidgets/modules/jqxradiobutton.js +36 -16
- package/jqwidgets/modules/jqxrangeselector.js +38 -18
- package/jqwidgets/modules/jqxrating.js +36 -16
- package/jqwidgets/modules/jqxrepeatbutton.js +34 -14
- package/jqwidgets/modules/jqxresponsivepanel.js +36 -16
- package/jqwidgets/modules/jqxribbon.js +38 -18
- package/jqwidgets/modules/jqxscheduler.js +74 -54
- package/jqwidgets/modules/jqxscrollbar.js +36 -16
- package/jqwidgets/modules/jqxscrollview.js +36 -16
- package/jqwidgets/modules/jqxslider.js +36 -16
- package/jqwidgets/modules/jqxsortable.js +36 -16
- package/jqwidgets/modules/jqxsplitlayout.js +34 -14
- package/jqwidgets/modules/jqxsplitter.js +36 -16
- package/jqwidgets/modules/jqxswitchbutton.js +40 -20
- package/jqwidgets/modules/jqxtabs.js +48 -28
- package/jqwidgets/modules/jqxtagcloud.js +42 -22
- package/jqwidgets/modules/jqxtextarea.js +42 -22
- package/jqwidgets/modules/jqxtimeline.js +34 -14
- package/jqwidgets/modules/jqxtimepicker.js +36 -16
- package/jqwidgets/modules/jqxtogglebutton.js +34 -14
- package/jqwidgets/modules/jqxtoolbar.js +66 -46
- package/jqwidgets/modules/jqxtooltip.js +34 -14
- package/jqwidgets/modules/jqxtree.js +46 -26
- package/jqwidgets/modules/jqxtreegrid.js +66 -46
- package/jqwidgets/modules/jqxtreemap.js +38 -18
- package/jqwidgets/modules/jqxvalidator.js +40 -20
- package/jqwidgets/modules/jqxwindow.js +36 -16
- package/package.json +1 -1
|
@@ -5,835 +5,5 @@ License: https://jqwidgets.com/license/
|
|
|
5
5
|
*/
|
|
6
6
|
/* eslint-disable */
|
|
7
7
|
|
|
8
|
-
/* tslint:disable */
|
|
9
|
-
/* eslint-disable */
|
|
10
|
-
(function () {
|
|
11
|
-
if (typeof document === 'undefined') {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
(function ($) {
|
|
16
|
-
$.extend($.jqx._jqxGrid.prototype, {
|
|
17
|
-
|
|
18
|
-
_exportData: function (dataFormat, dataExport, dataRows, settings) {
|
|
19
|
-
var that = this;
|
|
20
|
-
|
|
21
|
-
var fileName = typeof dataExport === 'string' ? dataExport : dataExport.fileName;
|
|
22
|
-
|
|
23
|
-
if (!fileName) {
|
|
24
|
-
fileName = 'jqxGrid';
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (!dataExport || typeof dataExport === 'string') {
|
|
28
|
-
dataExport =
|
|
29
|
-
{
|
|
30
|
-
header: true,
|
|
31
|
-
filterBy: null,
|
|
32
|
-
groupBy: null,
|
|
33
|
-
style: null,
|
|
34
|
-
fileName: fileName,
|
|
35
|
-
pageOrientation: 'portrait',
|
|
36
|
-
expandChart: '+',
|
|
37
|
-
collapseChar: '-'
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var dataExporter = new $.jqx.dataAdapter.DataExporter({ exportHeader: dataExport.header });
|
|
43
|
-
var formattedRows = [];
|
|
44
|
-
|
|
45
|
-
dataExporter.expandChar = dataExport.expandChar;
|
|
46
|
-
dataExporter.collapseChar = dataExport.collapseChar;
|
|
47
|
-
dataExporter.pageOrientation = dataExport.pageOrientation;
|
|
48
|
-
dataExporter.style = dataExport.style;
|
|
49
|
-
dataExporter.filterBy = dataExport.filterBy;
|
|
50
|
-
dataExporter.groupBy = dataExport.groupBy;
|
|
51
|
-
|
|
52
|
-
if (settings) {
|
|
53
|
-
dataExporter.addImageToCell = settings.addImageToCell;
|
|
54
|
-
dataExporter.headerContent = settings.headerContent;
|
|
55
|
-
dataExporter.footerContent = settings.footerContent;
|
|
56
|
-
dataExporter.setRowHeight = settings.setRowHeight;
|
|
57
|
-
dataExporter.cellFormatFunction = settings.cellFormatFunction;
|
|
58
|
-
dataExporter.freezeHeader = settings.freezeHeader;
|
|
59
|
-
dataExporter.exportAsTable = settings.exportAsTable;
|
|
60
|
-
dataExporter.onlySelected = settings.onlySelected;
|
|
61
|
-
dataExporter.autoConvertFormulas = settings.autoConvertFormulas;
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
var cols = [];
|
|
66
|
-
var colGroups = that.columngroups || [];
|
|
67
|
-
var index = 0;
|
|
68
|
-
|
|
69
|
-
if (colGroups) {
|
|
70
|
-
for (var i = 0; i < colGroups.length; i++) {
|
|
71
|
-
var column = colGroups[i];
|
|
72
|
-
|
|
73
|
-
column.label = column.text;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
for (var i = 0; i < that.columns.records.length; i++) {
|
|
78
|
-
var column = that.columns.records[i];
|
|
79
|
-
|
|
80
|
-
if (!column.exportable) {
|
|
81
|
-
continue;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (that.columns.records[i].datafield !== null) {
|
|
85
|
-
cols[index++] = { label: that.columns.records[i].text, width: that.columns.records[i].width ? that.columns.records[i].width + 'px' : '100px', dataField: that.columns.records[i].datafield, columnGroup: that.columns.records[i].columnGroup || that.columns.records[i].columngroup };
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
dataExporter.header = {
|
|
90
|
-
columns: cols,
|
|
91
|
-
columngroups: colGroups
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (!dataExport.style) {
|
|
95
|
-
var computedStyle = window.getComputedStyle(that.element);
|
|
96
|
-
var columnComputedStyle = window.getComputedStyle(that.columns.records.length > 0 && that.columns.records[0].element ? that.columns.records[0].element : that.host.find('.jqx-grid-header')[0]);
|
|
97
|
-
var headerComputedStyle = window.getComputedStyle(that.host.find('.jqx-grid-header')[0]);
|
|
98
|
-
var isHidden = that.offsetWidth === 0 || that.offsetHeight === 0;
|
|
99
|
-
|
|
100
|
-
if (!isHidden) {
|
|
101
|
-
var getStyle = function (computedStyle) {
|
|
102
|
-
var fontFamily = 'Helvetica';
|
|
103
|
-
var fontSize = computedStyle.fontSize;
|
|
104
|
-
var borderColor = computedStyle.borderRightColor;
|
|
105
|
-
var backgroundColor = computedStyle.backgroundColor;
|
|
106
|
-
var color = computedStyle.color;
|
|
107
|
-
|
|
108
|
-
var hexDigits = new Array
|
|
109
|
-
('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f');
|
|
110
|
-
|
|
111
|
-
var hex = function (x) {
|
|
112
|
-
return isNaN(x) ? '00' : hexDigits[(x - x % 16) / 16] + hexDigits[x % 16];
|
|
113
|
-
}
|
|
114
|
-
//Function to convert rgb color to hex format
|
|
115
|
-
var toHex = function (rgb) {
|
|
116
|
-
if (rgb.toString().indexOf('rgba') != -1) {
|
|
117
|
-
var rgbValue = color.split(',');
|
|
118
|
-
var r = parseInt(rgbValue[0].substring(5));
|
|
119
|
-
var g = parseInt(rgbValue[1]);
|
|
120
|
-
var b = parseInt(rgbValue[2]);
|
|
121
|
-
if (rgbValue[3]) {
|
|
122
|
-
var a = parseFloat(rgbValue[3].substring(1, 4));
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
var a = 1;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
var rgbObj = { r: r, g: g, b: b };
|
|
129
|
-
var hexValue = that._rgbToHex(rgbObj);
|
|
130
|
-
if (r == 0 && g == 0 && b == 0 && a == 0) {
|
|
131
|
-
return "#ffffff";
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
return "#" + hexValue;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
|
|
138
|
-
|
|
139
|
-
if (!rgb) {
|
|
140
|
-
return '#ffffff';
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
return '#' + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]).toUpperCase();
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
return {
|
|
147
|
-
borderColor: toHex(borderColor),
|
|
148
|
-
fontSize: fontSize,
|
|
149
|
-
fontFamily: fontFamily,
|
|
150
|
-
color: toHex(color),
|
|
151
|
-
backgroundColor: toHex(backgroundColor)
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
var gridStyle = getStyle(computedStyle);
|
|
156
|
-
var columnStyle = getStyle(columnComputedStyle);
|
|
157
|
-
var headerStyle = getStyle(headerComputedStyle);
|
|
158
|
-
|
|
159
|
-
var header = {
|
|
160
|
-
height: '30px',
|
|
161
|
-
border: '1px solid ' + gridStyle.borderColor,
|
|
162
|
-
fontFamily: headerStyle.fontFamily,
|
|
163
|
-
fontSize: headerStyle.fontSize,
|
|
164
|
-
color: headerStyle.color,
|
|
165
|
-
backgroundColor: columnStyle.backgroundColor,
|
|
166
|
-
fontWeight: '400'
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
var columns = {
|
|
170
|
-
border: '1px solid ' + gridStyle.borderColor,
|
|
171
|
-
fontFamily: gridStyle.fontFamily,
|
|
172
|
-
fontSize: gridStyle.fontSize
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
var rows = {
|
|
176
|
-
height: that.rowsheight + 'px'
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
for (var i = 0; i < that.columns.records.length; i++) {
|
|
180
|
-
var column = that.columns.records[i];
|
|
181
|
-
|
|
182
|
-
if (!column.exportable) {
|
|
183
|
-
continue;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
header[column.datafield] = {
|
|
187
|
-
textAlign: column.align,
|
|
188
|
-
width: column.width + 'px',
|
|
189
|
-
format: column.cellsformat || ''
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
var cellsFormat = column.cellsformat || '';
|
|
193
|
-
|
|
194
|
-
if (column.dataType === 'date') {
|
|
195
|
-
cellsFormat = 'd';
|
|
196
|
-
}
|
|
197
|
-
else if (column.dataType === 'dateTime') {
|
|
198
|
-
cellsFormat = 'D';
|
|
199
|
-
}
|
|
200
|
-
else if (column.dataType === 'time') {
|
|
201
|
-
cellsFormat = 't';
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
var columnStyleObject = {
|
|
205
|
-
textAlign: column.cellsalign,
|
|
206
|
-
format: cellsFormat
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
columns[column.datafield] = columnStyleObject;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
if (that.altrows) {
|
|
213
|
-
rows.alternationCount = 2;
|
|
214
|
-
rows.alternationStart = 0;
|
|
215
|
-
rows.alternationEnd = 0;
|
|
216
|
-
rows.alternationIndex0Color = gridStyle.color;
|
|
217
|
-
rows.alternationIndex0BackgroundColor = gridStyle.backgroundColor;
|
|
218
|
-
rows.alternationIndex1Color = gridStyle.color;
|
|
219
|
-
rows.alternationIndex1BackgroundColor = '#F5F5F5';
|
|
220
|
-
}
|
|
221
|
-
dataExporter.style = {
|
|
222
|
-
border: '1px solid ' + gridStyle.borderColor,
|
|
223
|
-
borderCollapse: 'collapse',
|
|
224
|
-
header: header,
|
|
225
|
-
columns: columns,
|
|
226
|
-
rows: rows
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
if (settings) {
|
|
232
|
-
if (settings.getSpreadsheets) {
|
|
233
|
-
const spreadsheets = settings.getSpreadsheets();
|
|
234
|
-
if (spreadsheets) {
|
|
235
|
-
dataExporter.spreadsheets = spreadsheets;
|
|
236
|
-
|
|
237
|
-
const header = dataExporter.style.header;
|
|
238
|
-
const columns = dataExporter.style.columns;
|
|
239
|
-
for (let p = 0; p < spreadsheets.length; p++) {
|
|
240
|
-
const sheet = spreadsheets[p];
|
|
241
|
-
const sheetColumns = sheet.columns;
|
|
242
|
-
for (let i = 0; i < sheetColumns.length; i++) {
|
|
243
|
-
let column = sheetColumns[i];
|
|
244
|
-
|
|
245
|
-
if (typeof column === 'string') {
|
|
246
|
-
column = {
|
|
247
|
-
label: column,
|
|
248
|
-
dataField: column,
|
|
249
|
-
allowExport: true,
|
|
250
|
-
visible: true
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
if (column.allowExport !== undefined && !column.allowExport) {
|
|
255
|
-
continue;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
if (column.visible !== undefined && !column.visible) {
|
|
259
|
-
continue;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
column.label = column.text;
|
|
263
|
-
|
|
264
|
-
header[column.dataField] = {
|
|
265
|
-
textAlign: column.align || 'left',
|
|
266
|
-
verticalAlign: 'center',
|
|
267
|
-
width: column.computedWidth ? column.computedWidth + 'px' : '100px',
|
|
268
|
-
format: column.cellsFormat || ''
|
|
269
|
-
};
|
|
270
|
-
|
|
271
|
-
let cellsFormat = column.cellsFormat || '';
|
|
272
|
-
|
|
273
|
-
if (!cellsFormat) {
|
|
274
|
-
if (column.dataType === 'date') {
|
|
275
|
-
cellsFormat = 'd';
|
|
276
|
-
}
|
|
277
|
-
else if (column.dataType === 'dateTime') {
|
|
278
|
-
cellsFormat = 'D';
|
|
279
|
-
}
|
|
280
|
-
else if (column.dataType === 'time') {
|
|
281
|
-
cellsFormat = 't';
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
if (that.locale && cellsFormat && cellsFormat.indexOf('c') >= 0 && dataFormat === 'xlsx') {
|
|
286
|
-
if (that.locale !== '' && that.locale !== 'en') {
|
|
287
|
-
const currencySign = that._getCurrencyByLocale(that.locale);
|
|
288
|
-
cellsFormat = currencySign + 'x' + cellsFormat;
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
const columnStyleObject = {
|
|
293
|
-
textAlign: column.cellsAlign || 'left',
|
|
294
|
-
format: cellsFormat
|
|
295
|
-
};
|
|
296
|
-
|
|
297
|
-
columns[column.dataField] = columnStyleObject;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
var viewRows = dataRows || this.getrows();
|
|
304
|
-
var data = [];
|
|
305
|
-
|
|
306
|
-
for (var i = 0; i < viewRows.length; i++) {
|
|
307
|
-
var row = viewRows[i];
|
|
308
|
-
|
|
309
|
-
if (row.hidden) {
|
|
310
|
-
continue;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
var rowObject = {};
|
|
314
|
-
|
|
315
|
-
for (var j = 0; j < that.columns.records.length; j++) {
|
|
316
|
-
var column = that.columns.records[j];
|
|
317
|
-
|
|
318
|
-
if (!column.exportable) {
|
|
319
|
-
continue;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
rowObject[column.datafield] = row[column.datafield];
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
data.push(rowObject);
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
if (!dataExport.groupBy && that.groups && that.groups.length) {
|
|
329
|
-
dataExporter.groupBy = that.groups.slice(0);
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
if (settings && settings.formatData) {
|
|
334
|
-
const formatDataCallback = (formattedData) => {
|
|
335
|
-
dataExporter.exportData(formattedData, dataFormat, dataExport.fileName, null);
|
|
336
|
-
}
|
|
337
|
-
settings.formatData([...data], cols, data, formatDataCallback);
|
|
338
|
-
}
|
|
339
|
-
else {
|
|
340
|
-
var output = dataExporter.exportData(data, dataFormat, dataExport.fileName, null);
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
return output;
|
|
344
|
-
},
|
|
345
|
-
|
|
346
|
-
exportview: function (datatype, filename, rows, settings) {
|
|
347
|
-
var that = this;
|
|
348
|
-
|
|
349
|
-
that._exportData(datatype, filename, rows, settings);
|
|
350
|
-
},
|
|
351
|
-
|
|
352
|
-
exportdata: function (datatype, filename, exportHeader, rows, exportHiddenColumns, exportServer, charset) {
|
|
353
|
-
if (!$.jqx.dataAdapter.ArrayExporter) {
|
|
354
|
-
throw 'jqxGrid: Missing reference to jqxdata.export.js!';
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
if (datatype === 'xlsx') {
|
|
358
|
-
this._exportData('xlsx', filename);
|
|
359
|
-
return;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
if (exportHeader == undefined) {
|
|
363
|
-
exportHeader = true;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
var me = this;
|
|
367
|
-
|
|
368
|
-
if (rows == undefined) {
|
|
369
|
-
var rows = this.getrows();
|
|
370
|
-
if (rows.length == 0) {
|
|
371
|
-
throw 'No data to export.';
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
this.exporting = true;
|
|
376
|
-
if (!this.pageable) {
|
|
377
|
-
this.loadondemand = true;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
if (this.altrows) {
|
|
381
|
-
this._renderrows(this.virtualsizeinfo);
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
var hValue = this.hScrollInstance.value;
|
|
385
|
-
|
|
386
|
-
this.hScrollInstance.setPosition(0);
|
|
387
|
-
this._renderrows(this.virtualsizeinfo);
|
|
388
|
-
|
|
389
|
-
var addhiddencolumns = exportHiddenColumns != undefined ? exportHiddenColumns : false;
|
|
390
|
-
var dataFields = {};
|
|
391
|
-
var styles = {};
|
|
392
|
-
var alignments = [];
|
|
393
|
-
var $cell = this.host.find('.jqx-grid-cell:first');
|
|
394
|
-
var $cellalt = this.host.find('.jqx-grid-cell-alt:first');
|
|
395
|
-
$cell.removeClass(this.toThemeProperty('jqx-grid-cell-selected'));
|
|
396
|
-
$cell.removeClass(this.toThemeProperty('jqx-fill-state-pressed'));
|
|
397
|
-
$cellalt.removeClass(this.toThemeProperty('jqx-grid-cell-selected'));
|
|
398
|
-
$cellalt.removeClass(this.toThemeProperty('jqx-fill-state-pressed'));
|
|
399
|
-
$cell.removeClass(this.toThemeProperty('jqx-grid-cell-hover'));
|
|
400
|
-
$cell.removeClass(this.toThemeProperty('jqx-fill-state-hover'));
|
|
401
|
-
$cellalt.removeClass(this.toThemeProperty('jqx-grid-cell-hover'));
|
|
402
|
-
$cellalt.removeClass(this.toThemeProperty('jqx-fill-state-hover'));
|
|
403
|
-
|
|
404
|
-
var styleName = 'cell';
|
|
405
|
-
var styleIndex = 1;
|
|
406
|
-
var columnStyleName = 'column';
|
|
407
|
-
var columnStyleIndex = 1;
|
|
408
|
-
var aggregates = [];
|
|
409
|
-
|
|
410
|
-
for (var j = 0; j < this.columns.records.length; j++) {
|
|
411
|
-
var column = this.columns.records[j];
|
|
412
|
-
if (column.cellclassname != "") {
|
|
413
|
-
column.customCellStyles = new Array();
|
|
414
|
-
if (typeof column.cellclassname == "string") {
|
|
415
|
-
for (var i = 0; i < rows.length; i++) {
|
|
416
|
-
column.customCellStyles[i] = column.cellclassname;
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
else {
|
|
420
|
-
for (var i = 0; i < rows.length; i++) {
|
|
421
|
-
var boundIndex = this.getrowboundindex(i);
|
|
422
|
-
var className = column.cellclassname(boundIndex, column.displayfield, rows[i][column.displayfield], rows[i]);
|
|
423
|
-
if (className) {
|
|
424
|
-
column.customCellStyles[i] = className;
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
var fields = new Array();
|
|
432
|
-
var firstColumn = null;
|
|
433
|
-
var firstCell = null;
|
|
434
|
-
var firstAltCell = null;
|
|
435
|
-
$.each(this.columns.records, function (index) {
|
|
436
|
-
var $cell = $(me.table[0].rows[0].cells[index]);
|
|
437
|
-
if (me.table[0].rows.length > 1) {
|
|
438
|
-
var $cellalt = $(me.table[0].rows[1].cells[index]);
|
|
439
|
-
if (!firstAltCell)
|
|
440
|
-
firstAltCell = $cellalt;
|
|
441
|
-
}
|
|
442
|
-
if (!firstCell) firstCell = $cell;
|
|
443
|
-
|
|
444
|
-
var column = this;
|
|
445
|
-
var removeClassFunc = function (cell) {
|
|
446
|
-
cell.removeClass(me.toThemeProperty('jqx-grid-cell-selected'));
|
|
447
|
-
cell.removeClass(me.toThemeProperty('jqx-fill-state-pressed'));
|
|
448
|
-
cell.removeClass(me.toThemeProperty('jqx-grid-cell-hover'));
|
|
449
|
-
cell.removeClass(me.toThemeProperty('jqx-fill-state-hover'));
|
|
450
|
-
if (column.customCellStyles) {
|
|
451
|
-
for (var o in column.customCellStyles) {
|
|
452
|
-
cell.removeClass(column.customCellStyles[o]);
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
removeClassFunc($cell);
|
|
457
|
-
if ($cellalt) {
|
|
458
|
-
removeClassFunc($cellalt);
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
if (this.displayfield == null) return true;
|
|
462
|
-
|
|
463
|
-
if (me.showaggregates) {
|
|
464
|
-
if (me.getcolumnaggregateddata) {
|
|
465
|
-
aggregates.push(me.getcolumnaggregateddata(this.displayfield, this.aggregates, true, rows));
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
var type = me._getexportcolumntype(this);
|
|
470
|
-
if (this.exportable && (!this.hidden || addhiddencolumns)) {
|
|
471
|
-
dataFields[this.displayfield] = {};
|
|
472
|
-
dataFields[this.displayfield].text = this.text;
|
|
473
|
-
dataFields[this.displayfield].width = parseInt(this.width);
|
|
474
|
-
if (isNaN(dataFields[this.displayfield].width)) dataFields[this.displayfield].width = 60;
|
|
475
|
-
dataFields[this.displayfield].formatString = this.cellsformat;
|
|
476
|
-
dataFields[this.displayfield].localization = me.gridlocalization;
|
|
477
|
-
dataFields[this.displayfield].type = type;
|
|
478
|
-
dataFields[this.displayfield].cellsAlign = this.cellsalign;
|
|
479
|
-
dataFields[this.displayfield].hidden = !exportHeader;
|
|
480
|
-
dataFields[this.displayfield].displayfield = this.displayfield;
|
|
481
|
-
fields.push(dataFields[this.displayfield]);
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
styleName = 'cell' + styleIndex;
|
|
485
|
-
|
|
486
|
-
var $element = $(this.element);
|
|
487
|
-
if (this.element == undefined) $element = $(this.uielement);
|
|
488
|
-
if (!firstColumn) {
|
|
489
|
-
firstColumn = $element;
|
|
490
|
-
}
|
|
491
|
-
else if (!column._rendered) {
|
|
492
|
-
$element = firstColumn;
|
|
493
|
-
$cell = firstCell;
|
|
494
|
-
$cellalt = firstAltCell;
|
|
495
|
-
var cellclass = me.toTP('jqx-grid-cell') + ' ' + me.toTP('jqx-item');
|
|
496
|
-
$cell[0].className = cellclass;
|
|
497
|
-
cellclass += me.toTP('jqx-grid-cell-alt');
|
|
498
|
-
if ($cellalt) {
|
|
499
|
-
$cellalt[0].className = cellclass;
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
columnStyleName = 'column' + columnStyleIndex;
|
|
504
|
-
if (datatype == 'html' || datatype == 'xls' || datatype == 'pdf') {
|
|
505
|
-
var buildStyle = function (styleName, $element, isColumn, altStyle, meColumn, me, index, customStyle, rowIndex) {
|
|
506
|
-
styles[styleName] = {};
|
|
507
|
-
if ($element == undefined)
|
|
508
|
-
return;
|
|
509
|
-
|
|
510
|
-
if ($element[0].offsetWidth == 0 || $element[0].offsetHeight == 0) {
|
|
511
|
-
if (!isColumn) {
|
|
512
|
-
styles[styleName]['dataType'] = type;
|
|
513
|
-
}
|
|
514
|
-
return;
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
styles[styleName]['font-size'] = $element.css('font-size');
|
|
518
|
-
styles[styleName]['font-weight'] = $element.css('font-weight');
|
|
519
|
-
styles[styleName]['font-style'] = $element.css('font-style');
|
|
520
|
-
styles[styleName]['background-color'] = me._getexportcolor($element.css('background-color'));
|
|
521
|
-
styles[styleName]['color'] = me._getexportcolor($element.css('color'));
|
|
522
|
-
styles[styleName]['border-color'] = me._getexportcolor($element.css('border-top-color'));
|
|
523
|
-
if (isColumn) {
|
|
524
|
-
styles[styleName]['text-align'] = meColumn.align;
|
|
525
|
-
}
|
|
526
|
-
else {
|
|
527
|
-
styles[styleName]['text-align'] = meColumn.cellsalign;
|
|
528
|
-
styles[styleName]['formatString'] = meColumn.cellsformat;
|
|
529
|
-
styles[styleName]['dataType'] = type;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
if (datatype == 'html' || datatype == 'pdf') {
|
|
533
|
-
styles[styleName]['border-top-width'] = $element.css('border-top-width');
|
|
534
|
-
styles[styleName]['border-left-width'] = $element.css('border-left-width');
|
|
535
|
-
styles[styleName]['border-right-width'] = $element.css('border-right-width');
|
|
536
|
-
styles[styleName]['border-bottom-width'] = $element.css('border-bottom-width');
|
|
537
|
-
styles[styleName]['border-top-style'] = $element.css('border-top-style');
|
|
538
|
-
styles[styleName]['border-left-style'] = $element.css('border-left-style');
|
|
539
|
-
styles[styleName]['border-right-style'] = $element.css('border-right-style');
|
|
540
|
-
styles[styleName]['border-bottom-style'] = $element.css('border-bottom-style');
|
|
541
|
-
if (isColumn) {
|
|
542
|
-
if (index == 0) {
|
|
543
|
-
styles[styleName]['border-left-width'] = $element.css('border-right-width');
|
|
544
|
-
}
|
|
545
|
-
styles[styleName]['border-top-width'] = $element.css('border-right-width');
|
|
546
|
-
styles[styleName]['border-bottom-width'] = $element.css('border-bottom-width');
|
|
547
|
-
}
|
|
548
|
-
else {
|
|
549
|
-
if (index == 0) {
|
|
550
|
-
styles[styleName]['border-left-width'] = $element.css('border-right-width');
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
styles[styleName]['height'] = $element.css('height');
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
if (meColumn.exportable && (!meColumn.hidden || addhiddencolumns)) {
|
|
557
|
-
if (customStyle == true) {
|
|
558
|
-
if (!dataFields[meColumn.displayfield].customCellStyles) {
|
|
559
|
-
dataFields[meColumn.displayfield].customCellStyles = new Array();
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
dataFields[meColumn.displayfield].customCellStyles[rowIndex] = styleName;
|
|
563
|
-
}
|
|
564
|
-
else {
|
|
565
|
-
if (isColumn) {
|
|
566
|
-
dataFields[meColumn.displayfield].style = styleName;
|
|
567
|
-
}
|
|
568
|
-
else if (!altStyle) {
|
|
569
|
-
dataFields[meColumn.displayfield].cellStyle = styleName;
|
|
570
|
-
}
|
|
571
|
-
else dataFields[meColumn.displayfield].cellAltStyle = styleName;
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
buildStyle(columnStyleName, $element, true, false, this, me, index);
|
|
576
|
-
columnStyleIndex++;
|
|
577
|
-
buildStyle(styleName, $cell, false, false, this, me, index);
|
|
578
|
-
if (me.altrows) {
|
|
579
|
-
styleName = 'cellalt' + styleIndex;
|
|
580
|
-
buildStyle(styleName, $cellalt, false, true, this, me, index);
|
|
581
|
-
}
|
|
582
|
-
if (this.customCellStyles) {
|
|
583
|
-
for (var o in column.customCellStyles) {
|
|
584
|
-
$cell.removeClass(column.customCellStyles[o]);
|
|
585
|
-
}
|
|
586
|
-
for (var o in column.customCellStyles) {
|
|
587
|
-
$cell.addClass(column.customCellStyles[o]);
|
|
588
|
-
buildStyle(styleName + column.customCellStyles[o], $cell, false, false, this, me, index, true, o);
|
|
589
|
-
$cell.removeClass(column.customCellStyles[o]);
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
styleIndex++;
|
|
594
|
-
}
|
|
595
|
-
});
|
|
596
|
-
$.each(this.columns.records, function (index) {
|
|
597
|
-
if (dataFields[this.displayfield]) {
|
|
598
|
-
dataFields[this.displayfield].columnsDataFields = fields;
|
|
599
|
-
}
|
|
600
|
-
});
|
|
601
|
-
|
|
602
|
-
if (this.showaggregates) {
|
|
603
|
-
var aggregatedrows = [];
|
|
604
|
-
var prefix = datatype == 'xls' ? "_AG" : "";
|
|
605
|
-
var offset = this.groupable ? this.groups.length : 0;
|
|
606
|
-
if (this.rowdetails) offset++;
|
|
607
|
-
if (this.selectionmode === "checkbox") offset++;
|
|
608
|
-
if (aggregates.length > 0) {
|
|
609
|
-
$.each(this.columns.records, function (index) {
|
|
610
|
-
if (this.aggregates) {
|
|
611
|
-
for (var i = 0; i < this.aggregates.length; i++) {
|
|
612
|
-
if (!aggregatedrows[i]) aggregatedrows[i] = {};
|
|
613
|
-
if (aggregatedrows[i]) {
|
|
614
|
-
var aggregatename = me._getaggregatename(this.aggregates[i]);
|
|
615
|
-
var aggregatetype = me._getaggregatetype(this.aggregates[i]);
|
|
616
|
-
var aggregate = aggregates[index - offset];
|
|
617
|
-
if (aggregate) {
|
|
618
|
-
aggregatedrows[i][this.displayfield] = prefix + aggregatename + ": " + aggregate[aggregatetype];
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
});
|
|
624
|
-
$.each(this.columns.records, function (index) {
|
|
625
|
-
for (var i = 0; i < aggregatedrows.length; i++) {
|
|
626
|
-
if (aggregatedrows[i][this.displayfield] == undefined) {
|
|
627
|
-
aggregatedrows[i][this.displayfield] = prefix;
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
});
|
|
631
|
-
}
|
|
632
|
-
$.each(aggregatedrows, function () {
|
|
633
|
-
rows.push(this);
|
|
634
|
-
});
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
var that = this;
|
|
638
|
-
var exporter = $.jqx.dataAdapter.ArrayExporter(rows, dataFields, styles);
|
|
639
|
-
if (filename == undefined) {
|
|
640
|
-
// update ui
|
|
641
|
-
this._renderrows(this.virtualsizeinfo);
|
|
642
|
-
var result = exporter.exportTo(datatype);
|
|
643
|
-
if (this.showaggregates) {
|
|
644
|
-
$.each(aggregatedrows, function () {
|
|
645
|
-
rows.pop(this);
|
|
646
|
-
});
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
setTimeout(function () {
|
|
650
|
-
that.exporting = false;
|
|
651
|
-
}, 50);
|
|
652
|
-
this.hScrollInstance.setPosition(hValue);
|
|
653
|
-
this._renderrows(this.virtualsizeinfo);
|
|
654
|
-
return result;
|
|
655
|
-
}
|
|
656
|
-
else {
|
|
657
|
-
exporter.exportToFile(datatype, filename, exportServer, charset);
|
|
658
|
-
}
|
|
659
|
-
// update ui
|
|
660
|
-
if (this.showaggregates) {
|
|
661
|
-
$.each(aggregatedrows, function () {
|
|
662
|
-
rows.pop(this);
|
|
663
|
-
});
|
|
664
|
-
}
|
|
665
|
-
this._renderrows(this.virtualsizeinfo);
|
|
666
|
-
setTimeout(function () {
|
|
667
|
-
that.exporting = false;
|
|
668
|
-
}, 50);
|
|
669
|
-
this.hScrollInstance.setPosition(hValue);
|
|
670
|
-
this._renderrows(this.virtualsizeinfo);
|
|
671
|
-
|
|
672
|
-
},
|
|
673
|
-
|
|
674
|
-
_getexportcolor: function (value) {
|
|
675
|
-
var color = value;
|
|
676
|
-
if (value == 'transparent') color = "#FFFFFF";
|
|
677
|
-
if (!color || !color.toString()) {
|
|
678
|
-
color = "#FFFFFF";
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
if (color.toString().indexOf('rgb') != -1) {
|
|
682
|
-
var rgb = color.split(',');
|
|
683
|
-
if (color.toString().indexOf('rgba') != -1) {
|
|
684
|
-
var r = parseInt(rgb[0].substring(5));
|
|
685
|
-
var g = parseInt(rgb[1]);
|
|
686
|
-
var b = parseInt(rgb[2]);
|
|
687
|
-
var a = parseFloat(rgb[3].substring(1, 4));
|
|
688
|
-
var rgbObj = { r: r, g: g, b: b };
|
|
689
|
-
var hex = this._rgbToHex(rgbObj);
|
|
690
|
-
if (r == 0 && g == 0 && b == 0 && a == 0) {
|
|
691
|
-
return "#ffffff";
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
return "#" + hex;
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
var r = parseInt(rgb[0].substring(4));
|
|
698
|
-
var g = parseInt(rgb[1]);
|
|
699
|
-
var b = parseInt(rgb[2].substring(1, 4));
|
|
700
|
-
var rgbObj = { r: r, g: g, b: b };
|
|
701
|
-
var hex = this._rgbToHex(rgbObj);
|
|
702
|
-
return "#" + hex;
|
|
703
|
-
}
|
|
704
|
-
else if (color.toString().indexOf('#') != -1) {
|
|
705
|
-
if (color.toString().length == 4) {
|
|
706
|
-
var colorPart = color.toString().substring(1, 4);
|
|
707
|
-
color += colorPart;
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
return color;
|
|
712
|
-
},
|
|
713
|
-
|
|
714
|
-
_rgbToHex: function (rgb) {
|
|
715
|
-
return this._intToHex(rgb.r) + this._intToHex(rgb.g) + this._intToHex(rgb.b);
|
|
716
|
-
},
|
|
717
|
-
|
|
718
|
-
_intToHex: function (dec) {
|
|
719
|
-
var result = (parseInt(dec).toString(16));
|
|
720
|
-
if (result.length == 1)
|
|
721
|
-
result = ("0" + result);
|
|
722
|
-
return result.toUpperCase();
|
|
723
|
-
},
|
|
724
|
-
|
|
725
|
-
_getexportcolumntype: function (column) {
|
|
726
|
-
var me = this;
|
|
727
|
-
var type = 'string';
|
|
728
|
-
var datafields = me.source.datafields || ((me.source._source) ? me.source._source.datafields : null);
|
|
729
|
-
|
|
730
|
-
if (datafields) {
|
|
731
|
-
var foundType = "";
|
|
732
|
-
$.each(datafields, function () {
|
|
733
|
-
if (this.name == column.displayfield) {
|
|
734
|
-
if (this.type) {
|
|
735
|
-
foundType = this.type;
|
|
736
|
-
}
|
|
737
|
-
return false;
|
|
738
|
-
}
|
|
739
|
-
});
|
|
740
|
-
if (foundType)
|
|
741
|
-
return foundType;
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
if (column != null) {
|
|
745
|
-
if (this.dataview.cachedrecords == undefined) {
|
|
746
|
-
return type;
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
var cell = null;
|
|
750
|
-
|
|
751
|
-
if (!this.virtualmode) {
|
|
752
|
-
if (this.dataview.cachedrecords.length == 0)
|
|
753
|
-
return type;
|
|
754
|
-
|
|
755
|
-
cell = this.dataview.cachedrecords[0][column.displayfield];
|
|
756
|
-
if (cell != null && cell.toString() == "") {
|
|
757
|
-
return "string";
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
else {
|
|
761
|
-
$.each(this.dataview.cachedrecords, function () {
|
|
762
|
-
cell = this[column.displayfield];
|
|
763
|
-
return false;
|
|
764
|
-
});
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
if (cell != null) {
|
|
768
|
-
if (column.cellsformat.indexOf('c') != -1) {
|
|
769
|
-
return 'number';
|
|
770
|
-
}
|
|
771
|
-
if (column.cellsformat.indexOf('n') != -1) {
|
|
772
|
-
return 'number';
|
|
773
|
-
}
|
|
774
|
-
if (column.cellsformat.indexOf('p') != -1) {
|
|
775
|
-
return 'number';
|
|
776
|
-
}
|
|
777
|
-
if (column.cellsformat.indexOf('d') != -1) {
|
|
778
|
-
return 'date';
|
|
779
|
-
}
|
|
780
|
-
if (column.cellsformat.indexOf('y') != -1) {
|
|
781
|
-
return 'date';
|
|
782
|
-
}
|
|
783
|
-
if (column.cellsformat.indexOf('M') != -1) {
|
|
784
|
-
return 'date';
|
|
785
|
-
}
|
|
786
|
-
if (column.cellsformat.indexOf('m') != -1) {
|
|
787
|
-
return 'date';
|
|
788
|
-
}
|
|
789
|
-
if (column.cellsformat.indexOf('t') != -1) {
|
|
790
|
-
return 'date';
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
if (typeof cell == 'boolean') {
|
|
794
|
-
type = 'boolean';
|
|
795
|
-
}
|
|
796
|
-
else if ($.jqx.dataFormat.isNumber(cell)) {
|
|
797
|
-
type = 'number';
|
|
798
|
-
}
|
|
799
|
-
else {
|
|
800
|
-
var tmpvalue = new Date(cell);
|
|
801
|
-
if (tmpvalue.toString() == 'NaN' || tmpvalue.toString() == "Invalid Date") {
|
|
802
|
-
if ($.jqx.dataFormat) {
|
|
803
|
-
tmpvalue = $.jqx.dataFormat.tryparsedate(cell);
|
|
804
|
-
if (tmpvalue != null) {
|
|
805
|
-
if (tmpvalue && tmpvalue.getFullYear()) {
|
|
806
|
-
if (tmpvalue.getFullYear() == 1970 && tmpvalue.getMonth() == 0 && tmpvalue.getDate() == 1) {
|
|
807
|
-
var num = new Number(cell);
|
|
808
|
-
if (!isNaN(num))
|
|
809
|
-
return 'number';
|
|
810
|
-
|
|
811
|
-
return 'string';
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
return 'date';
|
|
816
|
-
}
|
|
817
|
-
else {
|
|
818
|
-
type = 'string';
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
else type = 'string';
|
|
822
|
-
}
|
|
823
|
-
else {
|
|
824
|
-
type = 'date';
|
|
825
|
-
}
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
}
|
|
829
|
-
return type;
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
});
|
|
833
|
-
})(jqxBaseFramework);
|
|
834
|
-
})();
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
8
|
+
(function(){if(typeof document==="undefined"){return}(function(b){b.extend(b.jqx._jqxGrid.prototype,{_exportData:function(ai,T,at,Q){var ac=this;var ah=typeof T==="string"?T:T.fileName;if(!ah){ah="jqxGrid"}if(!T||typeof T==="string"){T={header:true,filterBy:null,groupBy:null,style:null,fileName:ah,pageOrientation:"portrait",expandChart:"+",collapseChar:"-"}}var a=new b.jqx.dataAdapter.DataExporter({exportHeader:T.header});var j=[];a.expandChar=T.expandChar;a.collapseChar=T.collapseChar;a.pageOrientation=T.pageOrientation;a.style=T.style;a.filterBy=T.filterBy;a.groupBy=T.groupBy;if(Q){a.addImageToCell=Q.addImageToCell;a.headerContent=Q.headerContent;a.footerContent=Q.footerContent;a.setRowHeight=Q.setRowHeight;a.cellFormatFunction=Q.cellFormatFunction;a.freezeHeader=Q.freezeHeader;a.exportAsTable=Q.exportAsTable;a.onlySelected=Q.onlySelected;a.autoConvertFormulas=Q.autoConvertFormulas}var al=[];var V=ac.columngroups||[];var ae=0;if(V){for(var S=0;S<V.length;S++){var Z=V[S];Z.label=Z.text}}for(var S=0;S<ac.columns.records.length;S++){var Z=ac.columns.records[S];if(!Z.exportable){continue}if(ac.columns.records[S].datafield!==null){al[ae++]={label:ac.columns.records[S].text,width:ac.columns.records[S].width?ac.columns.records[S].width+"px":"100px",dataField:ac.columns.records[S].datafield,columnGroup:ac.columns.records[S].columnGroup||ac.columns.records[S].columngroup}}}a.header={columns:al,columngroups:V};if(!T.style){var aj=window.getComputedStyle(ac.element);var ar=window.getComputedStyle(ac.columns.records.length>0&&ac.columns.records[0].element?ac.columns.records[0].element:ac.host.find(".jqx-grid-header")[0]);var ab=window.getComputedStyle(ac.host.find(".jqx-grid-header")[0]);var ao=ac.offsetWidth===0||ac.offsetHeight===0;if(!ao){var aa=function(h){var f="Helvetica";var d=h.fontSize;var c=h.borderRightColor;var e=h.backgroundColor;var k=h.color;var l=new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");var m=function(n){return isNaN(n)?"00":l[(n-n%16)/16]+l[n%16]};var g=function(t){if(t.toString().indexOf("rgba")!=-1){var v=k.split(",");var r=parseInt(v[0].substring(5));var s=parseInt(v[1]);var n=parseInt(v[2]);if(v[3]){var u=parseFloat(v[3].substring(1,4))}else{var u=1}var q={r:r,g:s,b:n};var o=ac._rgbToHex(q);if(r==0&&s==0&&n==0&&u==0){return"#ffffff"}return"#"+o}t=t.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);if(!t){return"#ffffff"}return"#"+m(t[1])+m(t[2])+m(t[3]).toUpperCase()};return{borderColor:g(c),fontSize:d,fontFamily:f,color:g(k),backgroundColor:g(e)}};var ap=aa(aj);var av=aa(ar);var aq=aa(ab);var au={height:"30px",border:"1px solid "+ap.borderColor,fontFamily:aq.fontFamily,fontSize:aq.fontSize,color:aq.color,backgroundColor:av.backgroundColor,fontWeight:"400"};var an={border:"1px solid "+ap.borderColor,fontFamily:ap.fontFamily,fontSize:ap.fontSize};var R={height:ac.rowsheight+"px"};for(var S=0;S<ac.columns.records.length;S++){var Z=ac.columns.records[S];if(!Z.exportable){continue}au[Z.datafield]={textAlign:Z.align,width:Z.width+"px",format:Z.cellsformat||""};var ax=Z.cellsformat||"";if(Z.dataType==="date"){ax="d"}else{if(Z.dataType==="dateTime"){ax="D"}else{if(Z.dataType==="time"){ax="t"}}}var af={textAlign:Z.cellsalign,format:ax};an[Z.datafield]=af}if(ac.altrows){R.alternationCount=2;R.alternationStart=0;R.alternationEnd=0;R.alternationIndex0Color=ap.color;R.alternationIndex0BackgroundColor=ap.backgroundColor;R.alternationIndex1Color=ap.color;R.alternationIndex1BackgroundColor="#F5F5F5"}a.style={border:"1px solid "+ap.borderColor,borderCollapse:"collapse",header:au,columns:an,rows:R}}}if(Q){if(Q.getSpreadsheets){var ay=Q.getSpreadsheets();if(ay){a.spreadsheets=ay;var au=a.style.header;var an=a.style.columns;for(var X=0;X<ay.length;X++){var ak=ay[X];var ad=ak.columns;for(var S=0;S<ad.length;S++){var Z=ad[S];if(typeof Z==="string"){Z={label:Z,dataField:Z,allowExport:true,visible:true}}if(Z.allowExport!==undefined&&!Z.allowExport){continue}if(Z.visible!==undefined&&!Z.visible){continue}Z.label=Z.text;au[Z.dataField]={textAlign:Z.align||"left",verticalAlign:"center",width:Z.computedWidth?Z.computedWidth+"px":"100px",format:Z.cellsFormat||""};var ax=Z.cellsFormat||"";if(!ax){if(Z.dataType==="date"){ax="d"}else{if(Z.dataType==="dateTime"){ax="D"}else{if(Z.dataType==="time"){ax="t"}}}}if(ac.locale&&ax&&ax.indexOf("c")>=0&&ai==="xlsx"){if(ac.locale!==""&&ac.locale!=="en"){var i=ac._getCurrencyByLocale(ac.locale);ax=i+"x"+ax}}var af={textAlign:Z.cellsAlign||"left",format:ax};an[Z.dataField]=af}}}}}var W=at||this.getrows();var p=[];for(var S=0;S<W.length;S++){var am=W[S];if(am.hidden){continue}var Y={};for(var U=0;U<ac.columns.records.length;U++){var Z=ac.columns.records[U];if(!Z.exportable){continue}Y[Z.datafield]=am[Z.datafield]}p.push(Y)}if(!T.groupBy&&ac.groups&&ac.groups.length){a.groupBy=ac.groups.slice(0)}if(Q&&Q.formatData){var aw=function(c){a.exportData(c,ai,T.fileName,null)};Q.formatData(p,al,p,aw)}else{var ag=a.exportData(p,ai,T.fileName,null)}return ag},exportview:function(i,a,g,j){var h=this;h._exportData(i,a,g,j)},exportdata:function(Z,ab,ac,ad,X,T,al){if(!b.jqx.dataAdapter.ArrayExporter){throw"jqxGrid: Missing reference to jqxdata.export.js!"}if(Z==="xlsx"){this._exportData("xlsx",ab);return}if(ac==undefined){ac=true}var a=this;if(ad==undefined){var ad=this.getrows();if(ad.length==0){throw"No data to export."}}this.exporting=true;if(!this.pageable){this.loadondemand=true}if(this.altrows){this._renderrows(this.virtualsizeinfo)}var ae=this.hScrollInstance.value;this.hScrollInstance.setPosition(0);this._renderrows(this.virtualsizeinfo);var M=X!=undefined?X:false;var R={};var af={};var P=[];var ah=this.host.find(".jqx-grid-cell:first");var N=this.host.find(".jqx-grid-cell-alt:first");ah.removeClass(this.toThemeProperty("jqx-grid-cell-selected"));ah.removeClass(this.toThemeProperty("jqx-fill-state-pressed"));N.removeClass(this.toThemeProperty("jqx-grid-cell-selected"));N.removeClass(this.toThemeProperty("jqx-fill-state-pressed"));ah.removeClass(this.toThemeProperty("jqx-grid-cell-hover"));ah.removeClass(this.toThemeProperty("jqx-fill-state-hover"));N.removeClass(this.toThemeProperty("jqx-grid-cell-hover"));N.removeClass(this.toThemeProperty("jqx-fill-state-hover"));var ak="cell";var am=1;var O="column";var ao=1;var aj=[];for(var W=0;W<this.columns.records.length;W++){var an=this.columns.records[W];if(an.cellclassname!=""){an.customCellStyles=new Array();if(typeof an.cellclassname=="string"){for(var V=0;V<ad.length;V++){an.customCellStyles[V]=an.cellclassname}}else{for(var V=0;V<ad.length;V++){var Q=this.getrowboundindex(V);var ap=an.cellclassname(Q,an.displayfield,ad[V][an.displayfield],ad[V]);if(ap){an.customCellStyles[V]=ap}}}}}var j=new Array();var i=null;var aq=null;var ar=null;b.each(this.columns.records,function(l){var d=b(a.table[0].rows[0].cells[l]);if(a.table[0].rows.length>1){var e=b(a.table[0].rows[1].cells[l]);if(!ar){ar=e}}if(!aq){aq=d}var m=this;var k=function(p){p.removeClass(a.toThemeProperty("jqx-grid-cell-selected"));p.removeClass(a.toThemeProperty("jqx-fill-state-pressed"));p.removeClass(a.toThemeProperty("jqx-grid-cell-hover"));p.removeClass(a.toThemeProperty("jqx-fill-state-hover"));if(m.customCellStyles){for(var o in m.customCellStyles){p.removeClass(m.customCellStyles[o])}}};k(d);if(e){k(e)}if(this.displayfield==null){return true}if(a.showaggregates){if(a.getcolumnaggregateddata){aj.push(a.getcolumnaggregateddata(this.displayfield,this.aggregates,true,ad))}}var g=a._getexportcolumntype(this);if(this.exportable&&(!this.hidden||M)){R[this.displayfield]={};R[this.displayfield].text=this.text;R[this.displayfield].width=parseInt(this.width);if(isNaN(R[this.displayfield].width)){R[this.displayfield].width=60}R[this.displayfield].formatString=this.cellsformat;R[this.displayfield].localization=a.gridlocalization;R[this.displayfield].type=g;R[this.displayfield].cellsAlign=this.cellsalign;R[this.displayfield].hidden=!ac;R[this.displayfield].displayfield=this.displayfield;j.push(R[this.displayfield])}ak="cell"+am;var c=b(this.element);if(this.element==undefined){c=b(this.uielement)}if(!i){i=c}else{if(!m._rendered){c=i;d=aq;e=ar;var h=a.toTP("jqx-grid-cell")+" "+a.toTP("jqx-item");d[0].className=h;h+=a.toTP("jqx-grid-cell-alt");if(e){e[0].className=h}}}O="column"+ao;if(Z=="html"||Z=="xls"||Z=="pdf"){var f=function(u,v,w,t,o,r,s,q,p){af[u]={};if(v==undefined){return}if(v[0].offsetWidth==0||v[0].offsetHeight==0){if(!w){af[u]["dataType"]=g}return}af[u]["font-size"]=v.css("font-size");af[u]["font-weight"]=v.css("font-weight");af[u]["font-style"]=v.css("font-style");af[u]["background-color"]=r._getexportcolor(v.css("background-color"));af[u]["color"]=r._getexportcolor(v.css("color"));af[u]["border-color"]=r._getexportcolor(v.css("border-top-color"));if(w){af[u]["text-align"]=o.align}else{af[u]["text-align"]=o.cellsalign;af[u]["formatString"]=o.cellsformat;af[u]["dataType"]=g}if(Z=="html"||Z=="pdf"){af[u]["border-top-width"]=v.css("border-top-width");af[u]["border-left-width"]=v.css("border-left-width");af[u]["border-right-width"]=v.css("border-right-width");af[u]["border-bottom-width"]=v.css("border-bottom-width");af[u]["border-top-style"]=v.css("border-top-style");af[u]["border-left-style"]=v.css("border-left-style");af[u]["border-right-style"]=v.css("border-right-style");af[u]["border-bottom-style"]=v.css("border-bottom-style");if(w){if(s==0){af[u]["border-left-width"]=v.css("border-right-width")}af[u]["border-top-width"]=v.css("border-right-width");af[u]["border-bottom-width"]=v.css("border-bottom-width")}else{if(s==0){af[u]["border-left-width"]=v.css("border-right-width")}}af[u]["height"]=v.css("height")}if(o.exportable&&(!o.hidden||M)){if(q==true){if(!R[o.displayfield].customCellStyles){R[o.displayfield].customCellStyles=new Array()}R[o.displayfield].customCellStyles[p]=u}else{if(w){R[o.displayfield].style=u}else{if(!t){R[o.displayfield].cellStyle=u}else{R[o.displayfield].cellAltStyle=u}}}}};f(O,c,true,false,this,a,l);ao++;f(ak,d,false,false,this,a,l);if(a.altrows){ak="cellalt"+am;f(ak,e,false,true,this,a,l)}if(this.customCellStyles){for(var n in m.customCellStyles){d.removeClass(m.customCellStyles[n])}for(var n in m.customCellStyles){d.addClass(m.customCellStyles[n]);f(ak+m.customCellStyles[n],d,false,false,this,a,l,true,n);d.removeClass(m.customCellStyles[n])}}am++}});b.each(this.columns.records,function(c){if(R[this.displayfield]){R[this.displayfield].columnsDataFields=j}});if(this.showaggregates){var S=[];var Y=Z=="xls"?"_AG":"";var ai=this.groupable?this.groups.length:0;if(this.rowdetails){ai++}if(this.selectionmode==="checkbox"){ai++}if(aj.length>0){b.each(this.columns.records,function(c){if(this.aggregates){for(var f=0;f<this.aggregates.length;f++){if(!S[f]){S[f]={}}if(S[f]){var e=a._getaggregatename(this.aggregates[f]);var d=a._getaggregatetype(this.aggregates[f]);var g=aj[c-ai];if(g){S[f][this.displayfield]=Y+e+": "+g[d]}}}}});b.each(this.columns.records,function(c){for(var d=0;d<S.length;d++){if(S[d][this.displayfield]==undefined){S[d][this.displayfield]=Y}}})}b.each(S,function(){ad.push(this)})}var ag=this;var U=b.jqx.dataAdapter.ArrayExporter(ad,R,af);if(ab==undefined){this._renderrows(this.virtualsizeinfo);var aa=U.exportTo(Z);if(this.showaggregates){b.each(S,function(){ad.pop(this)})}setTimeout(function(){ag.exporting=false},50);this.hScrollInstance.setPosition(ae);this._renderrows(this.virtualsizeinfo);return aa}else{U.exportToFile(Z,ab,T,al)}if(this.showaggregates){b.each(S,function(){ad.pop(this)})}this._renderrows(this.virtualsizeinfo);setTimeout(function(){ag.exporting=false},50);this.hScrollInstance.setPosition(ae);this._renderrows(this.virtualsizeinfo)},_getexportcolor:function(g){var r=g;if(g=="transparent"){r="#FFFFFF"}if(!r||!r.toString()){r="#FFFFFF"}if(r.toString().indexOf("rgb")!=-1){var p=r.split(",");if(r.toString().indexOf("rgba")!=-1){var t=parseInt(p[0].substring(5));var q=parseInt(p[1]);var o=parseInt(p[2]);var n=parseFloat(p[3].substring(1,4));var a={r:t,g:q,b:o};var s=this._rgbToHex(a);if(t==0&&q==0&&o==0&&n==0){return"#ffffff"}return"#"+s}var t=parseInt(p[0].substring(4));var q=parseInt(p[1]);var o=parseInt(p[2].substring(1,4));var a={r:t,g:q,b:o};var s=this._rgbToHex(a);return"#"+s}else{if(r.toString().indexOf("#")!=-1){if(r.toString().length==4){var u=r.toString().substring(1,4);r+=u}}}return r},_rgbToHex:function(a){return this._intToHex(a.r)+this._intToHex(a.g)+this._intToHex(a.b)},_intToHex:function(d){var a=(parseInt(d).toString(16));if(a.length==1){a=("0"+a)}return a.toUpperCase()},_getexportcolumntype:function(m){var l=this;var n="string";var o=l.source.datafields||((l.source._source)?l.source._source.datafields:null);if(o){var j="";b.each(o,function(){if(this.name==m.displayfield){if(this.type){j=this.type}return false}});if(j){return j}}if(m!=null){if(this.dataview.cachedrecords==undefined){return n}var a=null;if(!this.virtualmode){if(this.dataview.cachedrecords.length==0){return n}a=this.dataview.cachedrecords[0][m.displayfield];if(a!=null&&a.toString()==""){return"string"}}else{b.each(this.dataview.cachedrecords,function(){a=this[m.displayfield];return false})}if(a!=null){if(m.cellsformat.indexOf("c")!=-1){return"number"}if(m.cellsformat.indexOf("n")!=-1){return"number"}if(m.cellsformat.indexOf("p")!=-1){return"number"}if(m.cellsformat.indexOf("d")!=-1){return"date"}if(m.cellsformat.indexOf("y")!=-1){return"date"}if(m.cellsformat.indexOf("M")!=-1){return"date"}if(m.cellsformat.indexOf("m")!=-1){return"date"}if(m.cellsformat.indexOf("t")!=-1){return"date"}if(typeof a=="boolean"){n="boolean"}else{if(b.jqx.dataFormat.isNumber(a)){n="number"}else{var k=new Date(a);if(k.toString()=="NaN"||k.toString()=="Invalid Date"){if(b.jqx.dataFormat){k=b.jqx.dataFormat.tryparsedate(a);if(k!=null){if(k&&k.getFullYear()){if(k.getFullYear()==1970&&k.getMonth()==0&&k.getDate()==1){var p=new Number(a);if(!isNaN(p)){return"number"}return"string"}}return"date"}else{n="string"}}else{n="string"}}else{n="date"}}}}}return n}})})(jqxBaseFramework)})();
|
|
839
9
|
|