rails_jq_grid 0.0.3.pre2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/public/javascripts/rails-jqgrid/Changes.txt +0 -0
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-bg.js +132 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-bg1251.js +132 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-cat.js +128 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-cn.js +132 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-cs.js +128 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-da.js +128 -0
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-de.js +133 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-el.js +126 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-en.js +128 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-es.js +128 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-fa.js +145 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-fi.js +130 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-fr.js +126 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-gl.js +126 -0
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-he.js +127 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-hu.js +129 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-is.js +126 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-it.js +1 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-ja.js +155 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-nl.js +149 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-no.js +1 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-pl.js +127 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-pt-br.js +127 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-pt.js +125 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-ro.js +139 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-ru.js +127 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-sk.js +127 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-sr.js +128 -0
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-sv.js +127 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-tr.js +126 -1
- data/public/javascripts/rails-jqgrid/i18n/grid.locale-ua.js +127 -1
- data/public/javascripts/rails-jqgrid/install.txt +0 -0
- data/public/javascripts/rails-jqgrid/jquery.jqGrid.min.js +445 -432
- data/public/javascripts/rails-jqgrid/src/JsonXml.js +329 -329
- data/public/javascripts/rails-jqgrid/src/css/ellipsis-xbl.xml +0 -0
- data/public/javascripts/rails-jqgrid/src/css/ui.jqgrid.css +139 -129
- data/public/javascripts/rails-jqgrid/src/css/ui.multiselect.css +0 -0
- data/public/javascripts/rails-jqgrid/src/grid.base.js +3078 -3003
- data/public/javascripts/rails-jqgrid/src/grid.celledit.js +486 -486
- data/public/javascripts/rails-jqgrid/src/grid.common.js +646 -636
- data/public/javascripts/rails-jqgrid/src/grid.custom.js +820 -817
- data/public/javascripts/rails-jqgrid/src/grid.formedit.js +1954 -1872
- data/public/javascripts/rails-jqgrid/src/grid.grouping.js +250 -0
- data/public/javascripts/rails-jqgrid/src/grid.import.js +200 -200
- data/public/javascripts/rails-jqgrid/src/grid.inlinedit.js +255 -250
- data/public/javascripts/rails-jqgrid/src/grid.jqueryui.js +504 -503
- data/public/javascripts/rails-jqgrid/src/grid.loader.js +1 -0
- data/public/javascripts/rails-jqgrid/src/grid.postext.js +63 -63
- data/public/javascripts/rails-jqgrid/src/grid.setcolumns.js +125 -125
- data/public/javascripts/rails-jqgrid/src/grid.subgrid.js +260 -260
- data/public/javascripts/rails-jqgrid/src/grid.tbltogrid.js +106 -106
- data/public/javascripts/rails-jqgrid/src/grid.treegrid.js +489 -482
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-bg.js +132 -132
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-bg1251.js +132 -132
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-cat.js +128 -128
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-cn.js +132 -132
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-cs.js +128 -128
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-da.js +128 -0
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-de.js +132 -127
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-dk.js +0 -0
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-el.js +126 -126
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-en.js +128 -128
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-es.js +128 -128
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-fa.js +145 -125
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-fi.js +130 -130
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-fr.js +2 -2
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-gl.js +126 -0
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-he.js +127 -127
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-hu.js +129 -129
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-is.js +126 -126
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-it.js +0 -0
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-ja.js +155 -155
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-nl.js +148 -148
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-no.js +0 -0
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-pl.js +126 -126
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-pt-br.js +127 -127
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-pt.js +125 -125
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-ro.js +139 -139
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-ru.js +127 -127
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-sk.js +127 -127
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-sr.js +128 -0
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-sv.js +127 -127
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-tr.js +126 -126
- data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-ua.js +127 -127
- data/public/javascripts/rails-jqgrid/src/jqDnR.js +68 -67
- data/public/javascripts/rails-jqgrid/src/jqModal.js +68 -68
- data/public/javascripts/rails-jqgrid/src/jquery.fmatter.js +563 -541
- data/public/javascripts/rails-jqgrid/src/jquery.searchFilter.js +1 -1
- data/public/javascripts/rails-jqgrid/src/ui.multiselect.js +0 -0
- data/public/stylesheets/rails-jqgrid/ellipsis-xbl.xml +0 -0
- data/public/stylesheets/rails-jqgrid/ui.jqgrid.css +139 -2
- data/rails_jq_grid.gemspec +10 -3
- metadata +15 -11
@@ -1,1872 +1,1954 @@
|
|
1
|
-
;(function($){
|
2
|
-
/**
|
3
|
-
* jqGrid extension for form editing Grid Data
|
4
|
-
* Tony Tomov tony@trirand.com
|
5
|
-
* http://trirand.com/blog/
|
6
|
-
* Dual licensed under the MIT and GPL licenses:
|
7
|
-
* http://www.opensource.org/licenses/mit-license.php
|
8
|
-
* http://www.gnu.org/licenses/gpl-2.0.html
|
9
|
-
**/
|
10
|
-
var rp_ge = null;
|
11
|
-
$.jgrid.extend({
|
12
|
-
searchGrid : function (p) {
|
13
|
-
p = $.extend({
|
14
|
-
recreateFilter: false,
|
15
|
-
drag: true,
|
16
|
-
sField:'searchField',
|
17
|
-
sValue:'searchString',
|
18
|
-
sOper: 'searchOper',
|
19
|
-
sFilter: 'filters',
|
20
|
-
loadDefaults: true, // this options activates loading of default filters from grid's postData for Multipe Search only.
|
21
|
-
beforeShowSearch: null,
|
22
|
-
afterShowSearch : null,
|
23
|
-
onInitializeSearch: null,
|
24
|
-
closeAfterSearch : false,
|
25
|
-
closeAfterReset: false,
|
26
|
-
closeOnEscape : false,
|
27
|
-
multipleSearch : false,
|
28
|
-
cloneSearchRowOnAdd: true,
|
29
|
-
// translation
|
30
|
-
// if you want to change or remove the order change it in sopt
|
31
|
-
// ['bw','eq','ne','lt','le','gt','ge','ew','cn']
|
32
|
-
sopt: null,
|
33
|
-
// Note: stringResult is intentionally declared "undefined by default".
|
34
|
-
// you are velcome to define stringResult expressly in the options you pass to searchGrid()
|
35
|
-
// stringResult is a "safeguard" measure to insure we post sensible data when communicated as form-encoded
|
36
|
-
// see http://github.com/tonytomov/jqGrid/issues/#issue/36
|
37
|
-
//
|
38
|
-
// If this value is not expressly defined in the incoming options,
|
39
|
-
// lower in the code we will infer the value based on value of multipleSearch
|
40
|
-
stringResult: undefined,
|
41
|
-
onClose : null,
|
42
|
-
// useDataProxy allows ADD, EDIT and DEL code to bypass calling $.ajax
|
43
|
-
// directly when grid's 'dataProxy' property (grid.p.dataProxy) is a function.
|
44
|
-
// Used for "editGridRow" and "delGridRow" below and automatically flipped to TRUE
|
45
|
-
// when ajax setting's 'url' (grid's 'editurl') property is undefined.
|
46
|
-
// When 'useDataProxy' is true, instead of calling $.ajax.call(gridDOMobj, o, i) we call
|
47
|
-
// gridDOMobj.p.dataProxy.call(gridDOMobj, o, i)
|
48
|
-
//
|
49
|
-
// Behavior is extremely similar to when 'datatype' is a function, but arguments are slightly different.
|
50
|
-
// Normally the following is fed to datatype.call(a, b, c):
|
51
|
-
// a = Pointer to grid's table DOM element, b = grid.p.postdata, c = "load_"+grid's ID
|
52
|
-
// In cases of "edit" and "del" the following is fed:
|
53
|
-
// a = Pointer to grid's table DOM element (same),
|
54
|
-
// b = extended Ajax Options including postdata in "data" property. (different object type)
|
55
|
-
// c = "set_"+grid's ID in case of "edit" and "del_"+grid's ID in case of "del" (same type, different content)
|
56
|
-
// The major difference is that complete ajax options object, with attached "complete" and "error"
|
57
|
-
// callback functions is fed instead of only post data.
|
58
|
-
// This allows you to emulate a $.ajax call (including calling "complete"/"error"),
|
59
|
-
// while retrieving the data locally in the browser.
|
60
|
-
useDataProxy: false,
|
61
|
-
overlay : true
|
62
|
-
}, $.jgrid.search, p || {});
|
63
|
-
return this.each(function() {
|
64
|
-
var $t = this;
|
65
|
-
if(!$t.grid) {return;}
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
gridDOMobj
|
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
|
-
|
206
|
-
|
207
|
-
}
|
208
|
-
if(
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
}
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
}
|
467
|
-
|
468
|
-
|
469
|
-
if(
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
if(
|
476
|
-
$("
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
postdata
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
if(
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
$(
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
if(
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
}
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
}
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
}
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
$("#
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
$(".
|
1137
|
-
}
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1163
|
-
$(
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
}
|
1185
|
-
|
1186
|
-
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
}
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
1225
|
-
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
|
1236
|
-
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1253
|
-
|
1254
|
-
|
1255
|
-
|
1256
|
-
|
1257
|
-
|
1258
|
-
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
|
1263
|
-
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
}
|
1293
|
-
|
1294
|
-
|
1295
|
-
}
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
|
1406
|
-
|
1407
|
-
|
1408
|
-
|
1409
|
-
|
1410
|
-
|
1411
|
-
|
1412
|
-
|
1413
|
-
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1435
|
-
|
1436
|
-
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1447
|
-
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
|
1470
|
-
|
1471
|
-
|
1472
|
-
|
1473
|
-
|
1474
|
-
|
1475
|
-
|
1476
|
-
|
1477
|
-
|
1478
|
-
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
}
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
|
1515
|
-
|
1516
|
-
|
1517
|
-
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1532
|
-
|
1533
|
-
|
1534
|
-
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1538
|
-
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1552
|
-
|
1553
|
-
|
1554
|
-
|
1555
|
-
|
1556
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
1560
|
-
|
1561
|
-
|
1562
|
-
|
1563
|
-
|
1564
|
-
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
1575
|
-
|
1576
|
-
|
1577
|
-
|
1578
|
-
|
1579
|
-
|
1580
|
-
|
1581
|
-
|
1582
|
-
|
1583
|
-
|
1584
|
-
|
1585
|
-
|
1586
|
-
|
1587
|
-
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1593
|
-
|
1594
|
-
|
1595
|
-
|
1596
|
-
|
1597
|
-
|
1598
|
-
|
1599
|
-
|
1600
|
-
|
1601
|
-
|
1602
|
-
|
1603
|
-
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1615
|
-
|
1616
|
-
|
1617
|
-
|
1618
|
-
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
1622
|
-
|
1623
|
-
|
1624
|
-
|
1625
|
-
|
1626
|
-
|
1627
|
-
|
1628
|
-
}
|
1629
|
-
|
1630
|
-
|
1631
|
-
|
1632
|
-
|
1633
|
-
|
1634
|
-
|
1635
|
-
|
1636
|
-
|
1637
|
-
|
1638
|
-
|
1639
|
-
|
1640
|
-
|
1641
|
-
|
1642
|
-
|
1643
|
-
|
1644
|
-
|
1645
|
-
|
1646
|
-
|
1647
|
-
}
|
1648
|
-
|
1649
|
-
|
1650
|
-
|
1651
|
-
|
1652
|
-
|
1653
|
-
|
1654
|
-
|
1655
|
-
tbd =
|
1656
|
-
|
1657
|
-
|
1658
|
-
|
1659
|
-
|
1660
|
-
|
1661
|
-
|
1662
|
-
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
|
1667
|
-
|
1668
|
-
|
1669
|
-
|
1670
|
-
|
1671
|
-
|
1672
|
-
|
1673
|
-
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
1682
|
-
|
1683
|
-
|
1684
|
-
|
1685
|
-
|
1686
|
-
|
1687
|
-
|
1688
|
-
|
1689
|
-
|
1690
|
-
|
1691
|
-
|
1692
|
-
|
1693
|
-
|
1694
|
-
|
1695
|
-
|
1696
|
-
|
1697
|
-
|
1698
|
-
|
1699
|
-
|
1700
|
-
|
1701
|
-
.
|
1702
|
-
|
1703
|
-
|
1704
|
-
|
1705
|
-
|
1706
|
-
|
1707
|
-
|
1708
|
-
|
1709
|
-
|
1710
|
-
|
1711
|
-
|
1712
|
-
|
1713
|
-
|
1714
|
-
);
|
1715
|
-
tbd
|
1716
|
-
|
1717
|
-
|
1718
|
-
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1722
|
-
|
1723
|
-
|
1724
|
-
|
1725
|
-
|
1726
|
-
|
1727
|
-
|
1728
|
-
|
1729
|
-
|
1730
|
-
|
1731
|
-
|
1732
|
-
|
1733
|
-
|
1734
|
-
|
1735
|
-
|
1736
|
-
|
1737
|
-
|
1738
|
-
|
1739
|
-
|
1740
|
-
|
1741
|
-
|
1742
|
-
|
1743
|
-
|
1744
|
-
|
1745
|
-
|
1746
|
-
|
1747
|
-
|
1748
|
-
|
1749
|
-
|
1750
|
-
|
1751
|
-
|
1752
|
-
|
1753
|
-
|
1754
|
-
|
1755
|
-
|
1756
|
-
|
1757
|
-
|
1758
|
-
|
1759
|
-
|
1760
|
-
|
1761
|
-
|
1762
|
-
|
1763
|
-
|
1764
|
-
|
1765
|
-
|
1766
|
-
|
1767
|
-
|
1768
|
-
|
1769
|
-
|
1770
|
-
|
1771
|
-
|
1772
|
-
|
1773
|
-
|
1774
|
-
|
1775
|
-
|
1776
|
-
|
1777
|
-
|
1778
|
-
|
1779
|
-
|
1780
|
-
|
1781
|
-
|
1782
|
-
|
1783
|
-
|
1784
|
-
|
1785
|
-
|
1786
|
-
|
1787
|
-
|
1788
|
-
|
1789
|
-
|
1790
|
-
|
1791
|
-
|
1792
|
-
|
1793
|
-
|
1794
|
-
|
1795
|
-
|
1796
|
-
|
1797
|
-
|
1798
|
-
}
|
1799
|
-
|
1800
|
-
|
1801
|
-
|
1802
|
-
|
1803
|
-
|
1804
|
-
}
|
1805
|
-
|
1806
|
-
|
1807
|
-
|
1808
|
-
|
1809
|
-
|
1810
|
-
|
1811
|
-
|
1812
|
-
|
1813
|
-
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1817
|
-
|
1818
|
-
|
1819
|
-
|
1820
|
-
|
1821
|
-
|
1822
|
-
|
1823
|
-
|
1824
|
-
|
1825
|
-
|
1826
|
-
|
1827
|
-
|
1828
|
-
|
1829
|
-
|
1830
|
-
|
1831
|
-
|
1832
|
-
|
1833
|
-
|
1834
|
-
|
1835
|
-
|
1836
|
-
|
1837
|
-
|
1838
|
-
|
1839
|
-
|
1840
|
-
|
1841
|
-
|
1842
|
-
|
1843
|
-
|
1844
|
-
|
1845
|
-
|
1846
|
-
|
1847
|
-
|
1848
|
-
|
1849
|
-
|
1850
|
-
|
1851
|
-
|
1852
|
-
|
1853
|
-
|
1854
|
-
|
1855
|
-
|
1856
|
-
|
1857
|
-
|
1858
|
-
|
1859
|
-
|
1860
|
-
|
1861
|
-
if(!
|
1862
|
-
|
1863
|
-
var
|
1864
|
-
|
1865
|
-
|
1866
|
-
|
1867
|
-
|
1868
|
-
|
1869
|
-
|
1870
|
-
|
1871
|
-
|
1872
|
-
|
1
|
+
;(function($){
|
2
|
+
/**
|
3
|
+
* jqGrid extension for form editing Grid Data
|
4
|
+
* Tony Tomov tony@trirand.com
|
5
|
+
* http://trirand.com/blog/
|
6
|
+
* Dual licensed under the MIT and GPL licenses:
|
7
|
+
* http://www.opensource.org/licenses/mit-license.php
|
8
|
+
* http://www.gnu.org/licenses/gpl-2.0.html
|
9
|
+
**/
|
10
|
+
var rp_ge = null;
|
11
|
+
$.jgrid.extend({
|
12
|
+
searchGrid : function (p) {
|
13
|
+
p = $.extend({
|
14
|
+
recreateFilter: false,
|
15
|
+
drag: true,
|
16
|
+
sField:'searchField',
|
17
|
+
sValue:'searchString',
|
18
|
+
sOper: 'searchOper',
|
19
|
+
sFilter: 'filters',
|
20
|
+
loadDefaults: true, // this options activates loading of default filters from grid's postData for Multipe Search only.
|
21
|
+
beforeShowSearch: null,
|
22
|
+
afterShowSearch : null,
|
23
|
+
onInitializeSearch: null,
|
24
|
+
closeAfterSearch : false,
|
25
|
+
closeAfterReset: false,
|
26
|
+
closeOnEscape : false,
|
27
|
+
multipleSearch : false,
|
28
|
+
cloneSearchRowOnAdd: true,
|
29
|
+
// translation
|
30
|
+
// if you want to change or remove the order change it in sopt
|
31
|
+
// ['bw','eq','ne','lt','le','gt','ge','ew','cn']
|
32
|
+
sopt: null,
|
33
|
+
// Note: stringResult is intentionally declared "undefined by default".
|
34
|
+
// you are velcome to define stringResult expressly in the options you pass to searchGrid()
|
35
|
+
// stringResult is a "safeguard" measure to insure we post sensible data when communicated as form-encoded
|
36
|
+
// see http://github.com/tonytomov/jqGrid/issues/#issue/36
|
37
|
+
//
|
38
|
+
// If this value is not expressly defined in the incoming options,
|
39
|
+
// lower in the code we will infer the value based on value of multipleSearch
|
40
|
+
stringResult: undefined,
|
41
|
+
onClose : null,
|
42
|
+
// useDataProxy allows ADD, EDIT and DEL code to bypass calling $.ajax
|
43
|
+
// directly when grid's 'dataProxy' property (grid.p.dataProxy) is a function.
|
44
|
+
// Used for "editGridRow" and "delGridRow" below and automatically flipped to TRUE
|
45
|
+
// when ajax setting's 'url' (grid's 'editurl') property is undefined.
|
46
|
+
// When 'useDataProxy' is true, instead of calling $.ajax.call(gridDOMobj, o, i) we call
|
47
|
+
// gridDOMobj.p.dataProxy.call(gridDOMobj, o, i)
|
48
|
+
//
|
49
|
+
// Behavior is extremely similar to when 'datatype' is a function, but arguments are slightly different.
|
50
|
+
// Normally the following is fed to datatype.call(a, b, c):
|
51
|
+
// a = Pointer to grid's table DOM element, b = grid.p.postdata, c = "load_"+grid's ID
|
52
|
+
// In cases of "edit" and "del" the following is fed:
|
53
|
+
// a = Pointer to grid's table DOM element (same),
|
54
|
+
// b = extended Ajax Options including postdata in "data" property. (different object type)
|
55
|
+
// c = "set_"+grid's ID in case of "edit" and "del_"+grid's ID in case of "del" (same type, different content)
|
56
|
+
// The major difference is that complete ajax options object, with attached "complete" and "error"
|
57
|
+
// callback functions is fed instead of only post data.
|
58
|
+
// This allows you to emulate a $.ajax call (including calling "complete"/"error"),
|
59
|
+
// while retrieving the data locally in the browser.
|
60
|
+
useDataProxy: false,
|
61
|
+
overlay : true
|
62
|
+
}, $.jgrid.search, p || {});
|
63
|
+
return this.each(function() {
|
64
|
+
var $t = this;
|
65
|
+
if(!$t.grid) {return;}
|
66
|
+
var fid = "fbox_"+$t.p.id,
|
67
|
+
showFrm = true;
|
68
|
+
function applyDefaultFilters(gridDOMobj, filterSettings) {
|
69
|
+
/*
|
70
|
+
gridDOMobj = ointer to grid DOM object ( $(#list)[0] )
|
71
|
+
What we need from gridDOMobj:
|
72
|
+
gridDOMobj.SearchFilter is the pointer to the Search box, once it's created.
|
73
|
+
gridDOMobj.p.postData - dictionary of post settings. These can be overriden at grid creation to
|
74
|
+
contain default filter settings. We will parse these and will populate the search with defaults.
|
75
|
+
filterSettings - same settings object you (would) pass to $().jqGrid('searchGrid', filterSettings);
|
76
|
+
*/
|
77
|
+
|
78
|
+
// Pulling default filter settings out of postData property of grid's properties.:
|
79
|
+
var defaultFilters = gridDOMobj.p.postData[filterSettings.sFilter];
|
80
|
+
// example of what we might get: {"groupOp":"and","rules":[{"field":"amount","op":"eq","data":"100"}]}
|
81
|
+
// suppose we have imported this with grid import, the this is a string.
|
82
|
+
if(typeof(defaultFilters) == "string") {
|
83
|
+
defaultFilters = $.jgrid.parse(defaultFilters);
|
84
|
+
}
|
85
|
+
if (defaultFilters) {
|
86
|
+
if (defaultFilters.groupOp) {
|
87
|
+
gridDOMobj.SearchFilter.setGroupOp(defaultFilters.groupOp);
|
88
|
+
}
|
89
|
+
if (defaultFilters.rules) {
|
90
|
+
var f, i = 0, li = defaultFilters.rules.length, success = false;
|
91
|
+
for (; i < li; i++) {
|
92
|
+
f = defaultFilters.rules[i];
|
93
|
+
// we are not trying to counter all issues with filter declaration here. Just the basics to avoid lookup exceptions.
|
94
|
+
if (f.field !== undefined && f.op !== undefined && f.data !== undefined) {
|
95
|
+
success = gridDOMobj.SearchFilter.setFilter({
|
96
|
+
'sfref':gridDOMobj.SearchFilter.$.find(".sf:last"),
|
97
|
+
'filter':$.extend({},f)
|
98
|
+
});
|
99
|
+
if (success) { gridDOMobj.SearchFilter.add(); }
|
100
|
+
}
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
104
|
+
} // end of applyDefaultFilters
|
105
|
+
function hideFilter(selector) {
|
106
|
+
if(p.onClose){
|
107
|
+
var fclm = p.onClose(selector);
|
108
|
+
if(typeof fclm == 'boolean' && !fclm) { return; }
|
109
|
+
}
|
110
|
+
selector.hide();
|
111
|
+
if(p.overlay === true) {
|
112
|
+
$(".jqgrid-overlay:first","#gbox_"+$t.p.id).hide();
|
113
|
+
}
|
114
|
+
}
|
115
|
+
function showFilter(){
|
116
|
+
var fl = $(".ui-searchFilter").length;
|
117
|
+
if(fl > 1) {
|
118
|
+
var zI = $("#"+fid).css("zIndex");
|
119
|
+
$("#"+fid).css({zIndex:parseInt(zI,10)+fl});
|
120
|
+
}
|
121
|
+
$("#"+fid).show();
|
122
|
+
if(p.overlay === true) {
|
123
|
+
$(".jqgrid-overlay:first","#gbox_"+$t.p.id).show();
|
124
|
+
}
|
125
|
+
try{$(':input:visible',"#"+fid)[0].focus();}catch(_){}
|
126
|
+
}
|
127
|
+
function searchFilters(filters) {
|
128
|
+
var hasFilters = (filters !== undefined),
|
129
|
+
grid = $("#"+$t.p.id),
|
130
|
+
sdata={};
|
131
|
+
if(p.multipleSearch===false) {
|
132
|
+
sdata[p.sField] = filters.rules[0].field;
|
133
|
+
sdata[p.sValue] = filters.rules[0].data;
|
134
|
+
sdata[p.sOper] = filters.rules[0].op;
|
135
|
+
} else {
|
136
|
+
sdata[p.sFilter] = filters;
|
137
|
+
}
|
138
|
+
grid[0].p.search = hasFilters;
|
139
|
+
$.extend(grid[0].p.postData,sdata);
|
140
|
+
grid.trigger("reloadGrid",[{page:1}]);
|
141
|
+
if(p.closeAfterSearch) { hideFilter($("#"+fid)); }
|
142
|
+
}
|
143
|
+
function resetFilters(op) {
|
144
|
+
var reload = op && op.hasOwnProperty("reload") ? op.reload : true,
|
145
|
+
grid = $("#"+$t.p.id),
|
146
|
+
sdata={};
|
147
|
+
grid[0].p.search = false;
|
148
|
+
if(p.multipleSearch===false) {
|
149
|
+
sdata[p.sField] = sdata[p.sValue] = sdata[p.sOper] = "";
|
150
|
+
} else {
|
151
|
+
sdata[p.sFilter] = "";
|
152
|
+
}
|
153
|
+
$.extend(grid[0].p.postData,sdata);
|
154
|
+
if(reload) {
|
155
|
+
grid.trigger("reloadGrid",[{page:1}]);
|
156
|
+
}
|
157
|
+
if(p.closeAfterReset) { hideFilter($("#"+fid)); }
|
158
|
+
}
|
159
|
+
if($.fn.searchFilter) {
|
160
|
+
if(p.recreateFilter===true) {$("#"+fid).remove();}
|
161
|
+
if( $("#"+fid).html() != null ) {
|
162
|
+
if ( $.isFunction(p.beforeShowSearch) ) {
|
163
|
+
showFrm = p.beforeShowSearch($("#"+fid));
|
164
|
+
if(typeof(showFrm) == "undefined") {
|
165
|
+
showFrm = true;
|
166
|
+
}
|
167
|
+
}
|
168
|
+
if(showFrm === false) { return; }
|
169
|
+
showFilter();
|
170
|
+
if( $.isFunction(p.afterShowSearch) ) { p.afterShowSearch($("#"+fid)); }
|
171
|
+
} else {
|
172
|
+
var fields = [],
|
173
|
+
colNames = $("#"+$t.p.id).jqGrid("getGridParam","colNames"),
|
174
|
+
colModel = $("#"+$t.p.id).jqGrid("getGridParam","colModel"),
|
175
|
+
stempl = ['eq','ne','lt','le','gt','ge','bw','bn','in','ni','ew','en','cn','nc'],
|
176
|
+
j,pos,k,oprtr=[];
|
177
|
+
if (p.sopt !==null) {
|
178
|
+
k=0;
|
179
|
+
for(j=0;j<p.sopt.length;j++) {
|
180
|
+
if( (pos= $.inArray(p.sopt[j],stempl)) != -1 ){
|
181
|
+
oprtr[k] = {op:p.sopt[j],text: p.odata[pos]};
|
182
|
+
k++;
|
183
|
+
}
|
184
|
+
}
|
185
|
+
} else {
|
186
|
+
for(j=0;j<stempl.length;j++) {
|
187
|
+
oprtr[j] = {op:stempl[j],text: p.odata[j]};
|
188
|
+
}
|
189
|
+
}
|
190
|
+
$.each(colModel, function(i, v) {
|
191
|
+
var searchable = (typeof v.search === 'undefined') ? true: v.search ,
|
192
|
+
hidden = (v.hidden === true),
|
193
|
+
soptions = $.extend({}, {text: colNames[i], itemval: v.index || v.name}, this.searchoptions),
|
194
|
+
ignoreHiding = (soptions.searchhidden === true);
|
195
|
+
if(typeof soptions.sopt !== 'undefined') {
|
196
|
+
k=0;
|
197
|
+
soptions.ops =[];
|
198
|
+
if(soptions.sopt.length>0) {
|
199
|
+
for(j=0;j<soptions.sopt.length;j++) {
|
200
|
+
if( (pos= $.inArray(soptions.sopt[j],stempl)) != -1 ){
|
201
|
+
soptions.ops[k] = {op:soptions.sopt[j],text: p.odata[pos]};
|
202
|
+
k++;
|
203
|
+
}
|
204
|
+
}
|
205
|
+
}
|
206
|
+
}
|
207
|
+
if(typeof(this.stype) === 'undefined') { this.stype='text'; }
|
208
|
+
if(this.stype == 'select') {
|
209
|
+
if ( soptions.dataUrl !== undefined) {}
|
210
|
+
else {
|
211
|
+
var eov;
|
212
|
+
if(soptions.value) {
|
213
|
+
eov = soptions.value;
|
214
|
+
} else if(this.editoptions) {
|
215
|
+
eov = this.editoptions.value;
|
216
|
+
}
|
217
|
+
if(eov) {
|
218
|
+
soptions.dataValues =[];
|
219
|
+
if(typeof(eov) === 'string') {
|
220
|
+
var so = eov.split(";"),sv;
|
221
|
+
for(j=0;j<so.length;j++) {
|
222
|
+
sv = so[j].split(":");
|
223
|
+
soptions.dataValues[j] ={value:sv[0],text:sv[1]};
|
224
|
+
}
|
225
|
+
} else if (typeof(eov) === 'object') {
|
226
|
+
j=0;
|
227
|
+
for (var key in eov) {
|
228
|
+
if(eov.hasOwnProperty(key)) {
|
229
|
+
soptions.dataValues[j] ={value:key,text:eov[key]};
|
230
|
+
j++;
|
231
|
+
}
|
232
|
+
}
|
233
|
+
}
|
234
|
+
}
|
235
|
+
}
|
236
|
+
}
|
237
|
+
if ((ignoreHiding && searchable) || (searchable && !hidden)) {
|
238
|
+
fields.push(soptions);
|
239
|
+
}
|
240
|
+
});
|
241
|
+
if(fields.length>0){
|
242
|
+
$("<div id='"+fid+"' role='dialog' tabindex='-1'></div>").insertBefore("#gview_"+$t.p.id);
|
243
|
+
// Before we create searchFilter we need to decide if we want to get back a string or a JS object.
|
244
|
+
// see http://github.com/tonytomov/jqGrid/issues/#issue/36 for background on the issue.
|
245
|
+
// If p.stringResult is defined, it was explisitly passed to us by user. Honor the choice, whatever it is.
|
246
|
+
if (p.stringResult===undefined) {
|
247
|
+
// to provide backward compatibility, inferring stringResult value from multipleSearch
|
248
|
+
p.stringResult = p.multipleSearch;
|
249
|
+
}
|
250
|
+
// we preserve the return value here to retain access to .add() and other good methods of search form.
|
251
|
+
$t.SearchFilter = $("#"+fid).searchFilter(fields, { groupOps: p.groupOps, operators: oprtr, onClose:hideFilter, resetText: p.Reset, searchText: p.Find, windowTitle: p.caption, rulesText:p.rulesText, matchText:p.matchText, onSearch: searchFilters, onReset: resetFilters,stringResult:p.stringResult, ajaxSelectOptions: $.extend({},$.jgrid.ajaxOptions,$t.p.ajaxSelectOptions ||{}), clone: p.cloneSearchRowOnAdd });
|
252
|
+
$(".ui-widget-overlay","#"+fid).remove();
|
253
|
+
if($t.p.direction=="rtl") { $(".ui-closer","#"+fid).css("float","left"); }
|
254
|
+
if (p.drag===true) {
|
255
|
+
$("#"+fid+" table thead tr:first td:first").css('cursor','move');
|
256
|
+
if(jQuery.fn.jqDrag) {
|
257
|
+
$("#"+fid).jqDrag($("#"+fid+" table thead tr:first td:first"));
|
258
|
+
} else {
|
259
|
+
try {
|
260
|
+
$("#"+fid).draggable({handle: $("#"+fid+" table thead tr:first td:first")});
|
261
|
+
} catch (e) {}
|
262
|
+
}
|
263
|
+
}
|
264
|
+
if(p.multipleSearch === false) {
|
265
|
+
$(".ui-del, .ui-add, .ui-del, .ui-add-last, .matchText, .rulesText", "#"+fid).hide();
|
266
|
+
$("select[name='groupOp']","#"+fid).hide();
|
267
|
+
}
|
268
|
+
if (p.multipleSearch === true && p.loadDefaults === true) {
|
269
|
+
applyDefaultFilters($t, p);
|
270
|
+
}
|
271
|
+
if ( $.isFunction(p.onInitializeSearch) ) { p.onInitializeSearch( $("#"+fid) ); }
|
272
|
+
if ( $.isFunction(p.beforeShowSearch) ) {
|
273
|
+
showFrm = p.beforeShowSearch($("#"+fid));
|
274
|
+
if(typeof(showFrm) == "undefined") {
|
275
|
+
showFrm = true;
|
276
|
+
}
|
277
|
+
}
|
278
|
+
if(showFrm === false) { return; }
|
279
|
+
showFilter();
|
280
|
+
if( $.isFunction(p.afterShowSearch) ) { p.afterShowSearch($("#"+fid)); }
|
281
|
+
if(p.closeOnEscape===true){
|
282
|
+
$("#"+fid).keydown( function( e ) {
|
283
|
+
if( e.which == 27 ) {
|
284
|
+
hideFilter($("#"+fid));
|
285
|
+
}
|
286
|
+
if (e.which == 13) {
|
287
|
+
$(".ui-search", this).click();
|
288
|
+
}
|
289
|
+
});
|
290
|
+
}
|
291
|
+
}
|
292
|
+
}
|
293
|
+
}
|
294
|
+
});
|
295
|
+
},
|
296
|
+
editGridRow : function(rowid, p){
|
297
|
+
p = $.extend({
|
298
|
+
top : 0,
|
299
|
+
left: 0,
|
300
|
+
width: 300,
|
301
|
+
height: 'auto',
|
302
|
+
dataheight: 'auto',
|
303
|
+
modal: false,
|
304
|
+
overlay : 10,
|
305
|
+
drag: true,
|
306
|
+
resize: true,
|
307
|
+
url: null,
|
308
|
+
mtype : "POST",
|
309
|
+
clearAfterAdd :true,
|
310
|
+
closeAfterEdit : false,
|
311
|
+
reloadAfterSubmit : true,
|
312
|
+
onInitializeForm: null,
|
313
|
+
beforeInitData: null,
|
314
|
+
beforeShowForm: null,
|
315
|
+
afterShowForm: null,
|
316
|
+
beforeSubmit: null,
|
317
|
+
afterSubmit: null,
|
318
|
+
onclickSubmit: null,
|
319
|
+
afterComplete: null,
|
320
|
+
onclickPgButtons : null,
|
321
|
+
afterclickPgButtons: null,
|
322
|
+
editData : {},
|
323
|
+
recreateForm : false,
|
324
|
+
jqModal : true,
|
325
|
+
closeOnEscape : false,
|
326
|
+
addedrow : "first",
|
327
|
+
topinfo : '',
|
328
|
+
bottominfo: '',
|
329
|
+
saveicon : [],
|
330
|
+
closeicon : [],
|
331
|
+
savekey: [false,13],
|
332
|
+
navkeys: [false,38,40],
|
333
|
+
checkOnSubmit : false,
|
334
|
+
checkOnUpdate : false,
|
335
|
+
_savedData : {},
|
336
|
+
processing : false,
|
337
|
+
onClose : null,
|
338
|
+
ajaxEditOptions : {},
|
339
|
+
serializeEditData : null,
|
340
|
+
viewPagerButtons : true
|
341
|
+
}, $.jgrid.edit, p || {});
|
342
|
+
rp_ge = p;
|
343
|
+
return this.each(function(){
|
344
|
+
var $t = this;
|
345
|
+
if (!$t.grid || !rowid) { return; }
|
346
|
+
var gID = $t.p.id,
|
347
|
+
frmgr = "FrmGrid_"+gID,frmtb = "TblGrid_"+gID,
|
348
|
+
IDs = {themodal:'editmod'+gID,modalhead:'edithd'+gID,modalcontent:'editcnt'+gID, scrollelm : frmgr},
|
349
|
+
onBeforeShow = $.isFunction(rp_ge.beforeShowForm) ? rp_ge.beforeShowForm : false,
|
350
|
+
onAfterShow = $.isFunction(rp_ge.afterShowForm) ? rp_ge.afterShowForm : false,
|
351
|
+
onBeforeInit = $.isFunction(rp_ge.beforeInitData) ? rp_ge.beforeInitData : false,
|
352
|
+
onInitializeForm = $.isFunction(rp_ge.onInitializeForm) ? rp_ge.onInitializeForm : false,
|
353
|
+
copydata = null,
|
354
|
+
showFrm = true,
|
355
|
+
maxCols = 1, maxRows=0, postdata, extpost, newData, diff;
|
356
|
+
if (rowid=="new") {
|
357
|
+
rowid = "_empty";
|
358
|
+
p.caption=p.addCaption;
|
359
|
+
} else {
|
360
|
+
p.caption=p.editCaption;
|
361
|
+
}
|
362
|
+
if(p.recreateForm===true && $("#"+IDs.themodal).html() != null) {
|
363
|
+
$("#"+IDs.themodal).remove();
|
364
|
+
}
|
365
|
+
var closeovrl = true;
|
366
|
+
if(p.checkOnUpdate && p.jqModal && !p.modal) {
|
367
|
+
closeovrl = false;
|
368
|
+
}
|
369
|
+
function getFormData(){
|
370
|
+
$(".FormElement", "#"+frmtb).each(function(i) {
|
371
|
+
var celm = $(".customelement", this);
|
372
|
+
if (celm.length) {
|
373
|
+
var elem = celm[0], nm = $(elem).attr('name');
|
374
|
+
$.each($t.p.colModel, function(i,n){
|
375
|
+
if(this.name == nm && this.editoptions && $.isFunction(this.editoptions.custom_value)) {
|
376
|
+
try {
|
377
|
+
postdata[nm] = this.editoptions.custom_value($("#"+nm,"#"+frmtb),'get');
|
378
|
+
if (postdata[nm] === undefined) { throw "e1"; }
|
379
|
+
} catch (e) {
|
380
|
+
if (e=="e1") { $.jgrid.info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+$.jgrid.edit.msg.novalue,jQuery.jgrid.edit.bClose);}
|
381
|
+
else { $.jgrid.info_dialog(jQuery.jgrid.errors.errcap,e.message,jQuery.jgrid.edit.bClose); }
|
382
|
+
}
|
383
|
+
return true;
|
384
|
+
}
|
385
|
+
});
|
386
|
+
} else {
|
387
|
+
switch ($(this).get(0).type) {
|
388
|
+
case "checkbox":
|
389
|
+
if($(this).attr("checked")) {
|
390
|
+
postdata[this.name]= $(this).val();
|
391
|
+
}else {
|
392
|
+
var ofv = $(this).attr("offval");
|
393
|
+
postdata[this.name]= ofv;
|
394
|
+
}
|
395
|
+
break;
|
396
|
+
case "select-one":
|
397
|
+
postdata[this.name]= $("option:selected",this).val();
|
398
|
+
extpost[this.name]= $("option:selected",this).text();
|
399
|
+
break;
|
400
|
+
case "select-multiple":
|
401
|
+
postdata[this.name]= $(this).val();
|
402
|
+
if(postdata[this.name]) { postdata[this.name] = postdata[this.name].join(","); }
|
403
|
+
else { postdata[this.name] =""; }
|
404
|
+
var selectedText = [];
|
405
|
+
$("option:selected",this).each(
|
406
|
+
function(i,selected){
|
407
|
+
selectedText[i] = $(selected).text();
|
408
|
+
}
|
409
|
+
);
|
410
|
+
extpost[this.name]= selectedText.join(",");
|
411
|
+
break;
|
412
|
+
case "password":
|
413
|
+
case "text":
|
414
|
+
case "textarea":
|
415
|
+
case "button":
|
416
|
+
postdata[this.name] = $(this).val();
|
417
|
+
|
418
|
+
break;
|
419
|
+
}
|
420
|
+
if($t.p.autoencode) { postdata[this.name] = $.jgrid.htmlEncode(postdata[this.name]); }
|
421
|
+
}
|
422
|
+
});
|
423
|
+
return true;
|
424
|
+
}
|
425
|
+
function createData(rowid,obj,tb,maxcols){
|
426
|
+
var nm, hc,trdata, cnt=0,tmp, dc,elc, retpos=[], ind=false,
|
427
|
+
tdtmpl = "<td class='CaptionTD'> </td><td class='DataTD'> </td>", tmpl=""; //*2
|
428
|
+
for (var i =1;i<=maxcols;i++) {
|
429
|
+
tmpl += tdtmpl;
|
430
|
+
}
|
431
|
+
if(rowid != '_empty') {
|
432
|
+
ind = $(obj).jqGrid("getInd",rowid);
|
433
|
+
}
|
434
|
+
$(obj.p.colModel).each( function(i) {
|
435
|
+
nm = this.name;
|
436
|
+
// hidden fields are included in the form
|
437
|
+
if(this.editrules && this.editrules.edithidden === true) {
|
438
|
+
hc = false;
|
439
|
+
} else {
|
440
|
+
hc = this.hidden === true ? true : false;
|
441
|
+
}
|
442
|
+
dc = hc ? "style='display:none'" : "";
|
443
|
+
if ( nm !== 'cb' && nm !== 'subgrid' && this.editable===true && nm !== 'rn') {
|
444
|
+
if(ind === false) {
|
445
|
+
tmp = "";
|
446
|
+
} else {
|
447
|
+
if(nm == obj.p.ExpandColumn && obj.p.treeGrid === true) {
|
448
|
+
tmp = $("td:eq("+i+")",obj.rows[ind]).text();
|
449
|
+
} else {
|
450
|
+
try {
|
451
|
+
tmp = $.unformat($("td:eq("+i+")",obj.rows[ind]),{rowId:rowid, colModel:this},i);
|
452
|
+
} catch (_) {
|
453
|
+
tmp = $("td:eq("+i+")",obj.rows[ind]).html();
|
454
|
+
}
|
455
|
+
}
|
456
|
+
}
|
457
|
+
var opt = $.extend({}, this.editoptions || {} ,{id:nm,name:nm}),
|
458
|
+
frmopt = $.extend({}, {elmprefix:'',elmsuffix:'',rowabove:false,rowcontent:''}, this.formoptions || {}),
|
459
|
+
rp = parseInt(frmopt.rowpos,10) || cnt+1,
|
460
|
+
cp = parseInt((parseInt(frmopt.colpos,10) || 1)*2,10);
|
461
|
+
if(rowid == "_empty" && opt.defaultValue ) {
|
462
|
+
tmp = $.isFunction(opt.defaultValue) ? opt.defaultValue() : opt.defaultValue;
|
463
|
+
}
|
464
|
+
if(!this.edittype) { this.edittype = "text"; }
|
465
|
+
if($t.p.autoencode) { tmp = $.jgrid.htmlDecode(tmp); }
|
466
|
+
elc = $.jgrid.createEl(this.edittype,opt,tmp,false,$.extend({},$.jgrid.ajaxOptions,obj.p.ajaxSelectOptions || {}));
|
467
|
+
if(tmp === "" && this.edittype == "checkbox") {tmp = $(elc).attr("offval");}
|
468
|
+
if(tmp === "" && this.edittype == "select") {tmp = $("option:eq(0)",elc).text();}
|
469
|
+
if(rp_ge.checkOnSubmit || rp_ge.checkOnUpdate) { rp_ge._savedData[nm] = tmp; }
|
470
|
+
$(elc).addClass("FormElement");
|
471
|
+
if(this.edittype == 'text' || this.edittype == 'textarea') {
|
472
|
+
$(elc).addClass("ui-widget-content ui-corner-all");
|
473
|
+
}
|
474
|
+
trdata = $(tb).find("tr[rowpos="+rp+"]");
|
475
|
+
if(frmopt.rowabove) {
|
476
|
+
var newdata = $("<tr><td class='contentinfo' colspan='"+(maxcols*2)+"'>"+frmopt.rowcontent+"</td></tr>");
|
477
|
+
$(tb).append(newdata);
|
478
|
+
newdata[0].rp = rp;
|
479
|
+
}
|
480
|
+
if ( trdata.length===0 ) {
|
481
|
+
trdata = $("<tr "+dc+" rowpos='"+rp+"'></tr>").addClass("FormData").attr("id","tr_"+nm);
|
482
|
+
$(trdata).append(tmpl);
|
483
|
+
$(tb).append(trdata);
|
484
|
+
trdata[0].rp = rp;
|
485
|
+
}
|
486
|
+
$("td:eq("+(cp-2)+")",trdata[0]).html( typeof frmopt.label === 'undefined' ? obj.p.colNames[i]: frmopt.label);
|
487
|
+
$("td:eq("+(cp-1)+")",trdata[0]).append(frmopt.elmprefix).append(elc).append(frmopt.elmsuffix);
|
488
|
+
retpos[cnt] = i;
|
489
|
+
cnt++;
|
490
|
+
}
|
491
|
+
});
|
492
|
+
if( cnt > 0) {
|
493
|
+
var idrow = $("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+ (maxcols*2-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='"+obj.p.id+"_id' value='"+rowid+"'/></td></tr>");
|
494
|
+
idrow[0].rp = cnt+999;
|
495
|
+
$(tb).append(idrow);
|
496
|
+
if(rp_ge.checkOnSubmit || rp_ge.checkOnUpdate) { rp_ge._savedData[obj.p.id+"_id"] = rowid; }
|
497
|
+
}
|
498
|
+
return retpos;
|
499
|
+
}
|
500
|
+
function fillData(rowid,obj,fmid){
|
501
|
+
var nm,cnt=0,tmp, fld,opt,vl,vlc;
|
502
|
+
if(rp_ge.checkOnSubmit || rp_ge.checkOnUpdate) {rp_ge._savedData = {};rp_ge._savedData[obj.p.id+"_id"]=rowid;}
|
503
|
+
var cm = obj.p.colModel;
|
504
|
+
if(rowid == '_empty') {
|
505
|
+
$(cm).each(function(i){
|
506
|
+
nm = this.name;
|
507
|
+
opt = $.extend({}, this.editoptions || {} );
|
508
|
+
fld = $("#"+$.jgrid.jqID(nm),"#"+fmid);
|
509
|
+
if(fld[0] != null) {
|
510
|
+
vl = "";
|
511
|
+
if(opt.defaultValue ) {
|
512
|
+
vl = $.isFunction(opt.defaultValue) ? opt.defaultValue() : opt.defaultValue;
|
513
|
+
if(fld[0].type=='checkbox') {
|
514
|
+
vlc = vl.toLowerCase();
|
515
|
+
if(vlc.search(/(false|0|no|off|undefined)/i)<0 && vlc!=="") {
|
516
|
+
fld[0].checked = true;
|
517
|
+
fld[0].defaultChecked = true;
|
518
|
+
fld[0].value = vl;
|
519
|
+
} else {
|
520
|
+
fld.attr({checked:"",defaultChecked:""});
|
521
|
+
}
|
522
|
+
} else {fld.val(vl); }
|
523
|
+
} else {
|
524
|
+
if( fld[0].type=='checkbox' ) {
|
525
|
+
fld[0].checked = false;
|
526
|
+
fld[0].defaultChecked = false;
|
527
|
+
vl = $(fld).attr("offval");
|
528
|
+
} else if (fld[0].type && fld[0].type.substr(0,6)=='select') {
|
529
|
+
fld[0].selectedIndex = 0;
|
530
|
+
} else {
|
531
|
+
fld.val(vl);
|
532
|
+
}
|
533
|
+
}
|
534
|
+
if(rp_ge.checkOnSubmit===true || rp_ge.checkOnUpdate) { rp_ge._savedData[nm] = vl; }
|
535
|
+
}
|
536
|
+
});
|
537
|
+
$("#id_g","#"+fmid).val(rowid);
|
538
|
+
return;
|
539
|
+
}
|
540
|
+
var tre = $(obj).jqGrid("getInd",rowid,true);
|
541
|
+
if(!tre) { return; }
|
542
|
+
$('td',tre).each( function(i) {
|
543
|
+
nm = cm[i].name;
|
544
|
+
// hidden fields are included in the form
|
545
|
+
if ( nm !== 'cb' && nm !== 'subgrid' && nm !== 'rn' && cm[i].editable===true) {
|
546
|
+
if(nm == obj.p.ExpandColumn && obj.p.treeGrid === true) {
|
547
|
+
tmp = $(this).text();
|
548
|
+
} else {
|
549
|
+
try {
|
550
|
+
tmp = $.unformat($(this),{rowId:rowid, colModel:cm[i]},i);
|
551
|
+
} catch (_) {
|
552
|
+
tmp = $(this).html();
|
553
|
+
}
|
554
|
+
}
|
555
|
+
if($t.p.autoencode) { tmp = $.jgrid.htmlDecode(tmp); }
|
556
|
+
if(rp_ge.checkOnSubmit===true || rp_ge.checkOnUpdate) { rp_ge._savedData[nm] = tmp; }
|
557
|
+
nm = $.jgrid.jqID(nm);
|
558
|
+
switch (cm[i].edittype) {
|
559
|
+
case "password":
|
560
|
+
case "text":
|
561
|
+
case "button" :
|
562
|
+
case "image":
|
563
|
+
$("#"+nm,"#"+fmid).val(tmp);
|
564
|
+
break;
|
565
|
+
case "textarea":
|
566
|
+
if(tmp == " " || tmp == " " || (tmp.length==1 && tmp.charCodeAt(0)==160) ) {tmp='';}
|
567
|
+
$("#"+nm,"#"+fmid).val(tmp);
|
568
|
+
break;
|
569
|
+
case "select":
|
570
|
+
var opv = tmp.split(",");
|
571
|
+
opv = $.map(opv,function(n){return $.trim(n);});
|
572
|
+
$("#"+nm+" option","#"+fmid).each(function(j){
|
573
|
+
if (!cm[i].editoptions.multiple && (opv[0] == $.trim($(this).text()) || opv[0] == $.trim($(this).val())) ){
|
574
|
+
this.selected= true;
|
575
|
+
} else if (cm[i].editoptions.multiple){
|
576
|
+
if( $.inArray($.trim($(this).text()), opv ) > -1 || $.inArray($.trim($(this).val()), opv ) > -1 ){
|
577
|
+
this.selected = true;
|
578
|
+
}else{
|
579
|
+
this.selected = false;
|
580
|
+
}
|
581
|
+
} else {
|
582
|
+
this.selected = false;
|
583
|
+
}
|
584
|
+
});
|
585
|
+
break;
|
586
|
+
case "checkbox":
|
587
|
+
tmp = tmp+"";
|
588
|
+
if(cm[i].editoptions && cm[i].editoptions.value) {
|
589
|
+
var cb = cm[i].editoptions.value.split(":");
|
590
|
+
if(cb[0] == tmp) {
|
591
|
+
$("#"+nm,"#"+fmid).attr("checked",true);
|
592
|
+
$("#"+nm,"#"+fmid).attr("defaultChecked",true); //ie
|
593
|
+
} else {
|
594
|
+
$("#"+nm,"#"+fmid).attr("checked",false);
|
595
|
+
$("#"+nm,"#"+fmid).attr("defaultChecked",""); //ie
|
596
|
+
}
|
597
|
+
} else {
|
598
|
+
tmp = tmp.toLowerCase();
|
599
|
+
if(tmp.search(/(false|0|no|off|undefined)/i)<0 && tmp!=="") {
|
600
|
+
$("#"+nm,"#"+fmid).attr("checked",true);
|
601
|
+
$("#"+nm,"#"+fmid).attr("defaultChecked",true); //ie
|
602
|
+
} else {
|
603
|
+
$("#"+nm,"#"+fmid).attr("checked",false);
|
604
|
+
$("#"+nm,"#"+fmid).attr("defaultChecked",""); //ie
|
605
|
+
}
|
606
|
+
}
|
607
|
+
break;
|
608
|
+
case 'custom' :
|
609
|
+
try {
|
610
|
+
if(cm[i].editoptions && $.isFunction(cm[i].editoptions.custom_value)) {
|
611
|
+
cm[i].editoptions.custom_value($("#"+nm,"#"+fmid),'set',tmp);
|
612
|
+
} else { throw "e1"; }
|
613
|
+
} catch (e) {
|
614
|
+
if (e=="e1") { $.jgrid.info_dialog(jQuery.jgrid.errors.errcap,"function 'custom_value' "+$.jgrid.edit.msg.nodefined,jQuery.jgrid.edit.bClose);}
|
615
|
+
else { $.jgrid.info_dialog(jQuery.jgrid.errors.errcap,e.message,jQuery.jgrid.edit.bClose); }
|
616
|
+
}
|
617
|
+
break;
|
618
|
+
}
|
619
|
+
cnt++;
|
620
|
+
}
|
621
|
+
});
|
622
|
+
if(cnt>0) { $("#id_g","#"+frmtb).val(rowid); }
|
623
|
+
}
|
624
|
+
function postIt() {
|
625
|
+
var copydata, ret=[true,"",""], onCS = {}, opers = $t.p.prmNames, idname, oper;
|
626
|
+
if($.isFunction(rp_ge.beforeCheckValues)) {
|
627
|
+
var retvals = rp_ge.beforeCheckValues(postdata,$("#"+frmgr),postdata[$t.p.id+"_id"] == "_empty" ? opers.addoper : opers.editoper);
|
628
|
+
if(retvals && typeof(retvals) === 'object') { postdata = retvals; }
|
629
|
+
}
|
630
|
+
for( var key in postdata ){
|
631
|
+
if(postdata.hasOwnProperty(key)) {
|
632
|
+
ret = $.jgrid.checkValues(postdata[key],key,$t);
|
633
|
+
if(ret[0] === false) { break; }
|
634
|
+
}
|
635
|
+
}
|
636
|
+
if(ret[0]) {
|
637
|
+
if( $.isFunction( rp_ge.onclickSubmit)) { onCS = rp_ge.onclickSubmit(rp_ge,postdata) || {}; }
|
638
|
+
if( $.isFunction(rp_ge.beforeSubmit)) { ret = rp_ge.beforeSubmit(postdata,$("#"+frmgr)); }
|
639
|
+
}
|
640
|
+
|
641
|
+
if(ret[0] && !rp_ge.processing) {
|
642
|
+
rp_ge.processing = true;
|
643
|
+
$("#sData", "#"+frmtb+"_2").addClass('ui-state-active');
|
644
|
+
oper = opers.oper;
|
645
|
+
idname = opers.id;
|
646
|
+
// we add to pos data array the action - the name is oper
|
647
|
+
postdata[oper] = ($.trim(postdata[$t.p.id+"_id"]) == "_empty") ? opers.addoper : opers.editoper;
|
648
|
+
if(postdata[oper] != opers.addoper) {
|
649
|
+
postdata[idname] = postdata[$t.p.id+"_id"];
|
650
|
+
} else {
|
651
|
+
// check to see if we have allredy this field in the form and if yes lieve it
|
652
|
+
if( postdata[idname] === undefined ) { postdata[idname] = postdata[$t.p.id+"_id"]; }
|
653
|
+
}
|
654
|
+
delete postdata[$t.p.id+"_id"];
|
655
|
+
postdata = $.extend(postdata,rp_ge.editData,onCS);
|
656
|
+
|
657
|
+
var ajaxOptions = $.extend({
|
658
|
+
url: rp_ge.url ? rp_ge.url : $($t).jqGrid('getGridParam','editurl'),
|
659
|
+
type: rp_ge.mtype,
|
660
|
+
data: $.isFunction(rp_ge.serializeEditData) ? rp_ge.serializeEditData(postdata) : postdata,
|
661
|
+
complete:function(data,Status){
|
662
|
+
if(Status != "success") {
|
663
|
+
ret[0] = false;
|
664
|
+
if ($.isFunction(rp_ge.errorTextFormat)) {
|
665
|
+
ret[1] = rp_ge.errorTextFormat(data);
|
666
|
+
} else {
|
667
|
+
ret[1] = Status + " Status: '" + data.statusText + "'. Error code: " + data.status;
|
668
|
+
}
|
669
|
+
} else {
|
670
|
+
// data is posted successful
|
671
|
+
// execute aftersubmit with the returned data from server
|
672
|
+
if( $.isFunction(rp_ge.afterSubmit) ) {
|
673
|
+
ret = rp_ge.afterSubmit(data,postdata);
|
674
|
+
}
|
675
|
+
}
|
676
|
+
if(ret[0] === false) {
|
677
|
+
$("#FormError>td","#"+frmtb).html(ret[1]);
|
678
|
+
$("#FormError","#"+frmtb).show();
|
679
|
+
} else {
|
680
|
+
// remove some values if formattaer select or checkbox
|
681
|
+
$.each($t.p.colModel, function(i,n){
|
682
|
+
if(extpost[this.name] && this.formatter && this.formatter=='select') {
|
683
|
+
try {delete extpost[this.name];} catch (e) {}
|
684
|
+
}
|
685
|
+
});
|
686
|
+
postdata = $.extend(postdata,extpost);
|
687
|
+
if($t.p.autoencode) {
|
688
|
+
$.each(postdata,function(n,v){
|
689
|
+
postdata[n] = $.jgrid.htmlDecode(v);
|
690
|
+
});
|
691
|
+
}
|
692
|
+
rp_ge.reloadAfterSubmit = rp_ge.reloadAfterSubmit && $t.p.datatype != "local";
|
693
|
+
// the action is add
|
694
|
+
if(postdata[oper] == opers.addoper ) {
|
695
|
+
//id processing
|
696
|
+
// user not set the id ret[2]
|
697
|
+
if(!ret[2]) { ret[2] = (parseInt($t.p.records,10)+1)+""; }
|
698
|
+
postdata[idname] = ret[2];
|
699
|
+
if(rp_ge.closeAfterAdd) {
|
700
|
+
if(rp_ge.reloadAfterSubmit) { $($t).trigger("reloadGrid"); }
|
701
|
+
else {
|
702
|
+
$($t).jqGrid("addRowData",ret[2],postdata,p.addedrow);
|
703
|
+
$($t).jqGrid("setSelection",ret[2]);
|
704
|
+
}
|
705
|
+
$.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal,onClose: rp_ge.onClose});
|
706
|
+
} else if (rp_ge.clearAfterAdd) {
|
707
|
+
if(rp_ge.reloadAfterSubmit) { $($t).trigger("reloadGrid"); }
|
708
|
+
else { $($t).jqGrid("addRowData",ret[2],postdata,p.addedrow); }
|
709
|
+
fillData("_empty",$t,frmgr);
|
710
|
+
} else {
|
711
|
+
if(rp_ge.reloadAfterSubmit) { $($t).trigger("reloadGrid"); }
|
712
|
+
else { $($t).jqGrid("addRowData",ret[2],postdata,p.addedrow); }
|
713
|
+
}
|
714
|
+
} else {
|
715
|
+
// the action is update
|
716
|
+
if(rp_ge.reloadAfterSubmit) {
|
717
|
+
$($t).trigger("reloadGrid");
|
718
|
+
if( !rp_ge.closeAfterEdit ) { setTimeout(function(){$($t).jqGrid("setSelection",postdata[idname]);},1000); }
|
719
|
+
} else {
|
720
|
+
if($t.p.treeGrid === true) {
|
721
|
+
$($t).jqGrid("setTreeRow",postdata[idname],postdata);
|
722
|
+
} else {
|
723
|
+
$($t).jqGrid("setRowData",postdata[idname],postdata);
|
724
|
+
}
|
725
|
+
}
|
726
|
+
if(rp_ge.closeAfterEdit) { $.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal,onClose: rp_ge.onClose}); }
|
727
|
+
}
|
728
|
+
if($.isFunction(rp_ge.afterComplete)) {
|
729
|
+
copydata = data;
|
730
|
+
setTimeout(function(){rp_ge.afterComplete(copydata,postdata,$("#"+frmgr));copydata=null;},500);
|
731
|
+
}
|
732
|
+
}
|
733
|
+
rp_ge.processing=false;
|
734
|
+
if(rp_ge.checkOnSubmit || rp_ge.checkOnUpdate) {
|
735
|
+
$("#"+frmgr).data("disabled",false);
|
736
|
+
if(rp_ge._savedData[$t.p.id+"_id"] !="_empty"){
|
737
|
+
for(var key in rp_ge._savedData) {
|
738
|
+
if(postdata[key]) {
|
739
|
+
rp_ge._savedData[key] = postdata[key];
|
740
|
+
}
|
741
|
+
}
|
742
|
+
}
|
743
|
+
}
|
744
|
+
$("#sData", "#"+frmtb+"_2").removeClass('ui-state-active');
|
745
|
+
try{$(':input:visible',"#"+frmgr)[0].focus();} catch (e){}
|
746
|
+
},
|
747
|
+
error:function(xhr,st,err){
|
748
|
+
$("#FormError>td","#"+frmtb).html(st+ " : "+err);
|
749
|
+
$("#FormError","#"+frmtb).show();
|
750
|
+
rp_ge.processing=false;
|
751
|
+
$("#"+frmgr).data("disabled",false);
|
752
|
+
$("#sData", "#"+frmtb+"_2").removeClass('ui-state-active');
|
753
|
+
}
|
754
|
+
}, $.jgrid.ajaxOptions, rp_ge.ajaxEditOptions );
|
755
|
+
|
756
|
+
if (!ajaxOptions.url && !rp_ge.useDataProxy) {
|
757
|
+
if ($.isFunction($t.p.dataProxy)) {
|
758
|
+
rp_ge.useDataProxy = true;
|
759
|
+
} else {
|
760
|
+
ret[0]=false; ret[1] += " "+$.jgrid.errors.nourl;
|
761
|
+
}
|
762
|
+
}
|
763
|
+
if (ret[0]) {
|
764
|
+
if (rp_ge.useDataProxy) { $t.p.dataProxy.call($t, ajaxOptions, "set_"+$t.p.id); }
|
765
|
+
else { $.ajax(ajaxOptions); }
|
766
|
+
}
|
767
|
+
}
|
768
|
+
if(ret[0] === false) {
|
769
|
+
$("#FormError>td","#"+frmtb).html(ret[1]);
|
770
|
+
$("#FormError","#"+frmtb).show();
|
771
|
+
// return;
|
772
|
+
}
|
773
|
+
}
|
774
|
+
function compareData(nObj, oObj ) {
|
775
|
+
var ret = false,key;
|
776
|
+
for (key in nObj) {
|
777
|
+
if(nObj[key] != oObj[key]) {
|
778
|
+
ret = true;
|
779
|
+
break;
|
780
|
+
}
|
781
|
+
}
|
782
|
+
return ret;
|
783
|
+
}
|
784
|
+
function checkUpdates () {
|
785
|
+
var stat = true;
|
786
|
+
$("#FormError","#"+frmtb).hide();
|
787
|
+
if(rp_ge.checkOnUpdate) {
|
788
|
+
postdata = {}; extpost={};
|
789
|
+
getFormData();
|
790
|
+
newData = $.extend({},postdata,extpost);
|
791
|
+
diff = compareData(newData,rp_ge._savedData);
|
792
|
+
if(diff) {
|
793
|
+
$("#"+frmgr).data("disabled",true);
|
794
|
+
$(".confirm","#"+IDs.themodal).show();
|
795
|
+
stat = false;
|
796
|
+
}
|
797
|
+
}
|
798
|
+
return stat;
|
799
|
+
}
|
800
|
+
function restoreInline()
|
801
|
+
{
|
802
|
+
if (rowid !== "_empty" && typeof($t.p.savedRow) !== "undefined" && $t.p.savedRow.length > 0 && $.isFunction($.fn.jqGrid['restoreRow'])) {
|
803
|
+
for (var i=0;i<$t.p.savedRow.length;i++) {
|
804
|
+
if ($t.p.savedRow[i].id == rowid) {
|
805
|
+
$($t).jqGrid('restoreRow',rowid);
|
806
|
+
break;
|
807
|
+
}
|
808
|
+
}
|
809
|
+
}
|
810
|
+
}
|
811
|
+
if ( $("#"+IDs.themodal).html() != null ) {
|
812
|
+
if(onBeforeInit) {
|
813
|
+
showFrm = onBeforeInit($("#"+frmgr));
|
814
|
+
if(typeof(showFrm) == "undefined") {
|
815
|
+
showFrm = true;
|
816
|
+
}
|
817
|
+
}
|
818
|
+
if(showFrm === false) { return; }
|
819
|
+
restoreInline();
|
820
|
+
$(".ui-jqdialog-title","#"+IDs.modalhead).html(p.caption);
|
821
|
+
$("#FormError","#"+frmtb).hide();
|
822
|
+
if(rp_ge.topinfo) {
|
823
|
+
$(".topinfo","#"+frmtb+"_2").html(rp_ge.topinfo);
|
824
|
+
$(".tinfo","#"+frmtb+"_2").show();
|
825
|
+
} else {
|
826
|
+
$(".tinfo","#"+frmtb+"_2").hide();
|
827
|
+
}
|
828
|
+
if(rp_ge.bottominfo) {
|
829
|
+
$(".bottominfo","#"+frmtb+"_2").html(rp_ge.bottominfo);
|
830
|
+
$(".binfo","#"+frmtb+"_2").show();
|
831
|
+
} else {
|
832
|
+
$(".binfo","#"+frmtb+"_2").hide();
|
833
|
+
}
|
834
|
+
// filldata
|
835
|
+
fillData(rowid,$t,frmgr);
|
836
|
+
///
|
837
|
+
if(rowid=="_empty" || !rp_ge.viewPagerButtons) {
|
838
|
+
$("#pData, #nData","#"+frmtb+"_2").hide();
|
839
|
+
} else {
|
840
|
+
$("#pData, #nData","#"+frmtb+"_2").show();
|
841
|
+
}
|
842
|
+
if(rp_ge.processing===true) {
|
843
|
+
rp_ge.processing=false;
|
844
|
+
$("#sData", "#"+frmtb+"_2").removeClass('ui-state-active');
|
845
|
+
}
|
846
|
+
if($("#"+frmgr).data("disabled")===true) {
|
847
|
+
$(".confirm","#"+IDs.themodal).hide();
|
848
|
+
$("#"+frmgr).data("disabled",false);
|
849
|
+
}
|
850
|
+
if(onBeforeShow) { onBeforeShow($("#"+frmgr)); }
|
851
|
+
$("#"+IDs.themodal).data("onClose",rp_ge.onClose);
|
852
|
+
$.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal, jqM: false, overlay: p.overlay, modal:p.modal});
|
853
|
+
if(!closeovrl) {
|
854
|
+
$(".jqmOverlay").click(function(){
|
855
|
+
if(!checkUpdates()) { return false; }
|
856
|
+
$.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: rp_ge.onClose});
|
857
|
+
return false;
|
858
|
+
});
|
859
|
+
}
|
860
|
+
if(onAfterShow) { onAfterShow($("#"+frmgr)); }
|
861
|
+
} else {
|
862
|
+
var dh = isNaN(p.dataheight) ? p.dataheight : p.dataheight+"px",
|
863
|
+
frm = $("<form name='FormPost' id='"+frmgr+"' class='FormGrid' onSubmit='return false;' style='width:100%;overflow:auto;position:relative;height:"+dh+";'></form>").data("disabled",false),
|
864
|
+
tbl = $("<table id='"+frmtb+"' class='EditTable' cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>");
|
865
|
+
if(onBeforeInit) {
|
866
|
+
showFrm = onBeforeInit($("#"+frmgr));
|
867
|
+
if(typeof(showFrm) == "undefined") {
|
868
|
+
showFrm = true;
|
869
|
+
}
|
870
|
+
}
|
871
|
+
if(showFrm === false) { return; }
|
872
|
+
restoreInline();
|
873
|
+
$($t.p.colModel).each( function(i) {
|
874
|
+
var fmto = this.formoptions;
|
875
|
+
maxCols = Math.max(maxCols, fmto ? fmto.colpos || 0 : 0 );
|
876
|
+
maxRows = Math.max(maxRows, fmto ? fmto.rowpos || 0 : 0 );
|
877
|
+
});
|
878
|
+
$(frm).append(tbl);
|
879
|
+
var flr = $("<tr id='FormError' style='display:none'><td class='ui-state-error' colspan='"+(maxCols*2)+"'></td></tr>");
|
880
|
+
flr[0].rp = 0;
|
881
|
+
$(tbl).append(flr);
|
882
|
+
//topinfo
|
883
|
+
flr = $("<tr style='display:none' class='tinfo'><td class='topinfo' colspan='"+(maxCols*2)+"'>"+rp_ge.topinfo+"</td></tr>");
|
884
|
+
flr[0].rp = 0;
|
885
|
+
$(tbl).append(flr);
|
886
|
+
// set the id.
|
887
|
+
// use carefull only to change here colproperties.
|
888
|
+
// create data
|
889
|
+
var rtlb = $t.p.direction == "rtl" ? true :false,
|
890
|
+
bp = rtlb ? "nData" : "pData",
|
891
|
+
bn = rtlb ? "pData" : "nData";
|
892
|
+
createData(rowid,$t,tbl,maxCols);
|
893
|
+
// buttons at footer
|
894
|
+
var bP = "<a href='javascript:void(0)' id='"+bp+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></div>",
|
895
|
+
bN = "<a href='javascript:void(0)' id='"+bn+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></div>",
|
896
|
+
bS ="<a href='javascript:void(0)' id='sData' class='fm-button ui-state-default ui-corner-all'>"+p.bSubmit+"</a>",
|
897
|
+
bC ="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+p.bCancel+"</a>";
|
898
|
+
var bt = "<table border='0' cellspacing='0' cellpadding='0' class='EditTable' id='"+frmtb+"_2'><tbody><tr><td colspan='2'><hr class='ui-widget-content' style='margin:1px'/></td></tr><tr id='Act_Buttons'><td class='navButton'>"+(rtlb ? bN+bP : bP+bN)+"</td><td class='EditButton'>"+bS+bC+"</td></tr>";
|
899
|
+
bt += "<tr style='display:none' class='binfo'><td class='bottominfo' colspan='2'>"+rp_ge.bottominfo+"</td></tr>";
|
900
|
+
bt += "</tbody></table>";
|
901
|
+
if(maxRows > 0) {
|
902
|
+
var sd=[];
|
903
|
+
$.each($(tbl)[0].rows,function(i,r){
|
904
|
+
sd[i] = r;
|
905
|
+
});
|
906
|
+
sd.sort(function(a,b){
|
907
|
+
if(a.rp > b.rp) {return 1;}
|
908
|
+
if(a.rp < b.rp) {return -1;}
|
909
|
+
return 0;
|
910
|
+
});
|
911
|
+
$.each(sd, function(index, row) {
|
912
|
+
$('tbody',tbl).append(row);
|
913
|
+
});
|
914
|
+
}
|
915
|
+
p.gbox = "#gbox_"+gID;
|
916
|
+
var cle = false;
|
917
|
+
if(p.closeOnEscape===true){
|
918
|
+
p.closeOnEscape = false;
|
919
|
+
cle = true;
|
920
|
+
}
|
921
|
+
var tms = $("<span></span>").append(frm).append(bt);
|
922
|
+
$.jgrid.createModal(IDs,tms,p,"#gview_"+$t.p.id,$("#gbox_"+$t.p.id)[0]);
|
923
|
+
if(rtlb) {
|
924
|
+
$("#pData, #nData","#"+frmtb+"_2").css("float","right");
|
925
|
+
$(".EditButton","#"+frmtb+"_2").css("text-align","left");
|
926
|
+
}
|
927
|
+
if(rp_ge.topinfo) { $(".tinfo","#"+frmtb+"_2").show(); }
|
928
|
+
if(rp_ge.bottominfo) { $(".binfo","#"+frmtb+"_2").show(); }
|
929
|
+
tms = null; bt=null;
|
930
|
+
$("#"+IDs.themodal).keydown( function( e ) {
|
931
|
+
var wkey = e.target;
|
932
|
+
if ($("#"+frmgr).data("disabled")===true ) { return false; }//??
|
933
|
+
if(rp_ge.savekey[0] === true && e.which == rp_ge.savekey[1]) { // save
|
934
|
+
if(wkey.tagName != "TEXTAREA") {
|
935
|
+
$("#sData", "#"+frmtb+"_2").trigger("click");
|
936
|
+
return false;
|
937
|
+
}
|
938
|
+
}
|
939
|
+
if(e.which === 27) {
|
940
|
+
if(!checkUpdates()) { return false; }
|
941
|
+
if(cle) { $.jgrid.hideModal(this,{gb:p.gbox,jqm:p.jqModal, onClose: rp_ge.onClose}); }
|
942
|
+
return false;
|
943
|
+
}
|
944
|
+
if(rp_ge.navkeys[0]===true) {
|
945
|
+
if($("#id_g","#"+frmtb).val() == "_empty") { return true; }
|
946
|
+
if(e.which == rp_ge.navkeys[1]){ //up
|
947
|
+
$("#pData", "#"+frmtb+"_2").trigger("click");
|
948
|
+
return false;
|
949
|
+
}
|
950
|
+
if(e.which == rp_ge.navkeys[2]){ //down
|
951
|
+
$("#nData", "#"+frmtb+"_2").trigger("click");
|
952
|
+
return false;
|
953
|
+
}
|
954
|
+
}
|
955
|
+
});
|
956
|
+
if(p.checkOnUpdate) {
|
957
|
+
$("a.ui-jqdialog-titlebar-close span","#"+IDs.themodal).removeClass("jqmClose");
|
958
|
+
$("a.ui-jqdialog-titlebar-close","#"+IDs.themodal).unbind("click")
|
959
|
+
.click(function(){
|
960
|
+
if(!checkUpdates()) { return false; }
|
961
|
+
$.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal,onClose: rp_ge.onClose});
|
962
|
+
return false;
|
963
|
+
});
|
964
|
+
}
|
965
|
+
p.saveicon = $.extend([true,"left","ui-icon-disk"],p.saveicon);
|
966
|
+
p.closeicon = $.extend([true,"left","ui-icon-close"],p.closeicon);
|
967
|
+
// beforeinitdata after creation of the form
|
968
|
+
if(p.saveicon[0]===true) {
|
969
|
+
$("#sData","#"+frmtb+"_2").addClass(p.saveicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
|
970
|
+
.append("<span class='ui-icon "+p.saveicon[2]+"'></span>");
|
971
|
+
}
|
972
|
+
if(p.closeicon[0]===true) {
|
973
|
+
$("#cData","#"+frmtb+"_2").addClass(p.closeicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
|
974
|
+
.append("<span class='ui-icon "+p.closeicon[2]+"'></span>");
|
975
|
+
}
|
976
|
+
if(rp_ge.checkOnSubmit || rp_ge.checkOnUpdate) {
|
977
|
+
bS ="<a href='javascript:void(0)' id='sNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+p.bYes+"</a>";
|
978
|
+
bN ="<a href='javascript:void(0)' id='nNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+p.bNo+"</a>";
|
979
|
+
bC ="<a href='javascript:void(0)' id='cNew' class='fm-button ui-state-default ui-corner-all' style='z-index:1002'>"+p.bExit+"</a>";
|
980
|
+
var ii, zI = p.zIndex || 999; zI ++;
|
981
|
+
if ($.browser.msie && $.browser.version ==6) {
|
982
|
+
ii = '<iframe style="display:block;position:absolute;z-index:-1;filter:Alpha(Opacity=\'0\');" src="javascript:false;"></iframe>';
|
983
|
+
} else { ii="";}
|
984
|
+
$("<div class='ui-widget-overlay jqgrid-overlay confirm' style='z-index:"+zI+";display:none;'> "+ii+"</div><div class='confirm ui-widget-content ui-jqconfirm' style='z-index:"+(zI+1)+"'>"+p.saveData+"<br/><br/>"+bS+bN+bC+"</div>").insertAfter("#"+frmgr);
|
985
|
+
$("#sNew","#"+IDs.themodal).click(function(){
|
986
|
+
postIt();
|
987
|
+
$("#"+frmgr).data("disabled",false);
|
988
|
+
$(".confirm","#"+IDs.themodal).hide();
|
989
|
+
return false;
|
990
|
+
});
|
991
|
+
$("#nNew","#"+IDs.themodal).click(function(){
|
992
|
+
$(".confirm","#"+IDs.themodal).hide();
|
993
|
+
$("#"+frmgr).data("disabled",false);
|
994
|
+
setTimeout(function(){$(":input","#"+frmgr)[0].focus();},0);
|
995
|
+
return false;
|
996
|
+
});
|
997
|
+
$("#cNew","#"+IDs.themodal).click(function(){
|
998
|
+
$(".confirm","#"+IDs.themodal).hide();
|
999
|
+
$("#"+frmgr).data("disabled",false);
|
1000
|
+
$.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal,onClose: rp_ge.onClose});
|
1001
|
+
return false;
|
1002
|
+
});
|
1003
|
+
}
|
1004
|
+
// here initform - only once
|
1005
|
+
if(onInitializeForm) { onInitializeForm($("#"+frmgr)); }
|
1006
|
+
if(rowid=="_empty" || !rp_ge.viewPagerButtons) { $("#pData,#nData","#"+frmtb+"_2").hide(); } else { $("#pData,#nData","#"+frmtb+"_2").show(); }
|
1007
|
+
if(onBeforeShow) { onBeforeShow($("#"+frmgr)); }
|
1008
|
+
$("#"+IDs.themodal).data("onClose",rp_ge.onClose);
|
1009
|
+
$.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal, overlay: p.overlay,modal:p.modal});
|
1010
|
+
if(!closeovrl) {
|
1011
|
+
$(".jqmOverlay").click(function(){
|
1012
|
+
if(!checkUpdates()) { return false; }
|
1013
|
+
$.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: rp_ge.onClose});
|
1014
|
+
return false;
|
1015
|
+
});
|
1016
|
+
}
|
1017
|
+
if(onAfterShow) { onAfterShow($("#"+frmgr)); }
|
1018
|
+
$(".fm-button","#"+IDs.themodal).hover(
|
1019
|
+
function(){$(this).addClass('ui-state-hover');},
|
1020
|
+
function(){$(this).removeClass('ui-state-hover');}
|
1021
|
+
);
|
1022
|
+
$("#sData", "#"+frmtb+"_2").click(function(e){
|
1023
|
+
postdata = {}; extpost={};
|
1024
|
+
$("#FormError","#"+frmtb).hide();
|
1025
|
+
// all depend on ret array
|
1026
|
+
//ret[0] - succes
|
1027
|
+
//ret[1] - msg if not succes
|
1028
|
+
//ret[2] - the id that will be set if reload after submit false
|
1029
|
+
getFormData();
|
1030
|
+
if(postdata[$t.p.id+"_id"] == "_empty") { postIt(); }
|
1031
|
+
else if(p.checkOnSubmit===true ) {
|
1032
|
+
newData = $.extend({},postdata,extpost);
|
1033
|
+
diff = compareData(newData,rp_ge._savedData);
|
1034
|
+
if(diff) {
|
1035
|
+
$("#"+frmgr).data("disabled",true);
|
1036
|
+
$(".confirm","#"+IDs.themodal).show();
|
1037
|
+
} else {
|
1038
|
+
postIt();
|
1039
|
+
}
|
1040
|
+
} else {
|
1041
|
+
postIt();
|
1042
|
+
}
|
1043
|
+
return false;
|
1044
|
+
});
|
1045
|
+
$("#cData", "#"+frmtb+"_2").click(function(e){
|
1046
|
+
if(!checkUpdates()) { return false; }
|
1047
|
+
$.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal,onClose: rp_ge.onClose});
|
1048
|
+
return false;
|
1049
|
+
});
|
1050
|
+
$("#nData", "#"+frmtb+"_2").click(function(e){
|
1051
|
+
if(!checkUpdates()) { return false; }
|
1052
|
+
$("#FormError","#"+frmtb).hide();
|
1053
|
+
var npos = getCurrPos();
|
1054
|
+
npos[0] = parseInt(npos[0],10);
|
1055
|
+
if(npos[0] != -1 && npos[1][npos[0]+1]) {
|
1056
|
+
if($.isFunction(p.onclickPgButtons)) {
|
1057
|
+
p.onclickPgButtons('next',$("#"+frmgr),npos[1][npos[0]]);
|
1058
|
+
}
|
1059
|
+
fillData(npos[1][npos[0]+1],$t,frmgr);
|
1060
|
+
$($t).jqGrid("setSelection",npos[1][npos[0]+1]);
|
1061
|
+
if($.isFunction(p.afterclickPgButtons)) {
|
1062
|
+
p.afterclickPgButtons('next',$("#"+frmgr),npos[1][npos[0]+1]);
|
1063
|
+
}
|
1064
|
+
updateNav(npos[0]+1,npos[1].length-1);
|
1065
|
+
}
|
1066
|
+
return false;
|
1067
|
+
});
|
1068
|
+
$("#pData", "#"+frmtb+"_2").click(function(e){
|
1069
|
+
if(!checkUpdates()) { return false; }
|
1070
|
+
$("#FormError","#"+frmtb).hide();
|
1071
|
+
var ppos = getCurrPos();
|
1072
|
+
if(ppos[0] != -1 && ppos[1][ppos[0]-1]) {
|
1073
|
+
if($.isFunction(p.onclickPgButtons)) {
|
1074
|
+
p.onclickPgButtons('prev',$("#"+frmgr),ppos[1][ppos[0]]);
|
1075
|
+
}
|
1076
|
+
fillData(ppos[1][ppos[0]-1],$t,frmgr);
|
1077
|
+
$($t).jqGrid("setSelection",ppos[1][ppos[0]-1]);
|
1078
|
+
if($.isFunction(p.afterclickPgButtons)) {
|
1079
|
+
p.afterclickPgButtons('prev',$("#"+frmgr),ppos[1][ppos[0]-1]);
|
1080
|
+
}
|
1081
|
+
updateNav(ppos[0]-1,ppos[1].length-1);
|
1082
|
+
}
|
1083
|
+
return false;
|
1084
|
+
});
|
1085
|
+
}
|
1086
|
+
function updateNav(cr,totr,rid){
|
1087
|
+
if (cr===0) { $("#pData","#"+frmtb+"_2").addClass('ui-state-disabled'); } else { $("#pData","#"+frmtb+"_2").removeClass('ui-state-disabled'); }
|
1088
|
+
if (cr==totr) { $("#nData","#"+frmtb+"_2").addClass('ui-state-disabled'); } else { $("#nData","#"+frmtb+"_2").removeClass('ui-state-disabled'); }
|
1089
|
+
}
|
1090
|
+
function getCurrPos() {
|
1091
|
+
var rowsInGrid = $($t).jqGrid("getDataIDs"),
|
1092
|
+
selrow = $("#id_g","#"+frmtb).val(),
|
1093
|
+
pos = $.inArray(selrow,rowsInGrid);
|
1094
|
+
return [pos,rowsInGrid];
|
1095
|
+
}
|
1096
|
+
|
1097
|
+
var posInit =getCurrPos();
|
1098
|
+
updateNav(posInit[0],posInit[1].length-1);
|
1099
|
+
|
1100
|
+
});
|
1101
|
+
},
|
1102
|
+
viewGridRow : function(rowid, p){
|
1103
|
+
p = $.extend({
|
1104
|
+
top : 0,
|
1105
|
+
left: 0,
|
1106
|
+
width: 0,
|
1107
|
+
height: 'auto',
|
1108
|
+
dataheight: 'auto',
|
1109
|
+
modal: false,
|
1110
|
+
overlay: 10,
|
1111
|
+
drag: true,
|
1112
|
+
resize: true,
|
1113
|
+
jqModal: true,
|
1114
|
+
closeOnEscape : false,
|
1115
|
+
labelswidth: '30%',
|
1116
|
+
closeicon: [],
|
1117
|
+
navkeys: [false,38,40],
|
1118
|
+
onClose: null,
|
1119
|
+
beforeShowForm : null,
|
1120
|
+
beforeInitData : null,
|
1121
|
+
viewPagerButtons : true
|
1122
|
+
}, $.jgrid.view, p || {});
|
1123
|
+
return this.each(function(){
|
1124
|
+
var $t = this;
|
1125
|
+
if (!$t.grid || !rowid) { return; }
|
1126
|
+
if(!p.imgpath) { p.imgpath= $t.p.imgpath; }
|
1127
|
+
// I hate to rewrite code, but ...
|
1128
|
+
var gID = $t.p.id,
|
1129
|
+
frmgr = "ViewGrid_"+gID , frmtb = "ViewTbl_"+gID,
|
1130
|
+
IDs = {themodal:'viewmod'+gID,modalhead:'viewhd'+gID,modalcontent:'viewcnt'+gID, scrollelm : frmgr},
|
1131
|
+
onBeforeInit = $.isFunction(p.beforeInitData) ? p.beforeInitData : false,
|
1132
|
+
showFrm = true,
|
1133
|
+
maxCols = 1, maxRows=0;
|
1134
|
+
function focusaref(){ //Sfari 3 issues
|
1135
|
+
if(p.closeOnEscape===true || p.navkeys[0]===true) {
|
1136
|
+
setTimeout(function(){$(".ui-jqdialog-titlebar-close","#"+IDs.modalhead).focus();},0);
|
1137
|
+
}
|
1138
|
+
}
|
1139
|
+
function createData(rowid,obj,tb,maxcols){
|
1140
|
+
var nm, hc,trdata, cnt=0,tmp, dc, retpos=[], ind=false,
|
1141
|
+
tdtmpl = "<td class='CaptionTD form-view-label ui-widget-content' width='"+p.labelswidth+"'> </td><td class='DataTD form-view-data ui-helper-reset ui-widget-content'> </td>", tmpl="",
|
1142
|
+
tdtmpl2 = "<td class='CaptionTD form-view-label ui-widget-content'> </td><td class='DataTD form-view-data ui-widget-content'> </td>",
|
1143
|
+
fmtnum = ['integer','number','currency'],max1 =0, max2=0 ,maxw,setme, viewfld;
|
1144
|
+
for (var i =1;i<=maxcols;i++) {
|
1145
|
+
tmpl += i == 1 ? tdtmpl : tdtmpl2;
|
1146
|
+
}
|
1147
|
+
// find max number align rigth with property formatter
|
1148
|
+
$(obj.p.colModel).each( function(i) {
|
1149
|
+
if(this.editrules && this.editrules.edithidden === true) {
|
1150
|
+
hc = false;
|
1151
|
+
} else {
|
1152
|
+
hc = this.hidden === true ? true : false;
|
1153
|
+
}
|
1154
|
+
if(!hc && this.align==='right') {
|
1155
|
+
if(this.formatter && $.inArray(this.formatter,fmtnum) !== -1 ) {
|
1156
|
+
max1 = Math.max(max1,parseInt(this.width,10));
|
1157
|
+
} else {
|
1158
|
+
max2 = Math.max(max2,parseInt(this.width,10));
|
1159
|
+
}
|
1160
|
+
}
|
1161
|
+
});
|
1162
|
+
maxw = max1 !==0 ? max1 : max2 !==0 ? max2 : 0;
|
1163
|
+
ind = $(obj).jqGrid("getInd",rowid);
|
1164
|
+
$(obj.p.colModel).each( function(i) {
|
1165
|
+
nm = this.name;
|
1166
|
+
setme = false;
|
1167
|
+
// hidden fields are included in the form
|
1168
|
+
if(this.editrules && this.editrules.edithidden === true) {
|
1169
|
+
hc = false;
|
1170
|
+
} else {
|
1171
|
+
hc = this.hidden === true ? true : false;
|
1172
|
+
}
|
1173
|
+
dc = hc ? "style='display:none'" : "";
|
1174
|
+
viewfld = (typeof this.viewable != 'boolean') ? true : this.viewable;
|
1175
|
+
if ( nm !== 'cb' && nm !== 'subgrid' && nm !== 'rn' && viewfld) {
|
1176
|
+
if(ind === false) {
|
1177
|
+
tmp = "";
|
1178
|
+
} else {
|
1179
|
+
if(nm == obj.p.ExpandColumn && obj.p.treeGrid === true) {
|
1180
|
+
tmp = $("td:eq("+i+")",obj.rows[ind]).text();
|
1181
|
+
} else {
|
1182
|
+
tmp = $("td:eq("+i+")",obj.rows[ind]).html();
|
1183
|
+
}
|
1184
|
+
}
|
1185
|
+
setme = this.align === 'right' && maxw !==0 ? true : false;
|
1186
|
+
var opt = $.extend({}, this.editoptions || {} ,{id:nm,name:nm}),
|
1187
|
+
frmopt = $.extend({},{rowabove:false,rowcontent:''}, this.formoptions || {}),
|
1188
|
+
rp = parseInt(frmopt.rowpos,10) || cnt+1,
|
1189
|
+
cp = parseInt((parseInt(frmopt.colpos,10) || 1)*2,10);
|
1190
|
+
if(frmopt.rowabove) {
|
1191
|
+
var newdata = $("<tr><td class='contentinfo' colspan='"+(maxcols*2)+"'>"+frmopt.rowcontent+"</td></tr>");
|
1192
|
+
$(tb).append(newdata);
|
1193
|
+
newdata[0].rp = rp;
|
1194
|
+
}
|
1195
|
+
trdata = $(tb).find("tr[rowpos="+rp+"]");
|
1196
|
+
if ( trdata.length===0 ) {
|
1197
|
+
trdata = $("<tr "+dc+" rowpos='"+rp+"'></tr>").addClass("FormData").attr("id","trv_"+nm);
|
1198
|
+
$(trdata).append(tmpl);
|
1199
|
+
$(tb).append(trdata);
|
1200
|
+
trdata[0].rp = rp;
|
1201
|
+
}
|
1202
|
+
$("td:eq("+(cp-2)+")",trdata[0]).html('<b>'+ (typeof frmopt.label === 'undefined' ? obj.p.colNames[i]: frmopt.label)+'</b>');
|
1203
|
+
$("td:eq("+(cp-1)+")",trdata[0]).append("<span>"+tmp+"</span>").attr("id","v_"+nm);
|
1204
|
+
if(setme){
|
1205
|
+
$("td:eq("+(cp-1)+") span",trdata[0]).css({'text-align':'right',width:maxw+"px"});
|
1206
|
+
}
|
1207
|
+
retpos[cnt] = i;
|
1208
|
+
cnt++;
|
1209
|
+
}
|
1210
|
+
});
|
1211
|
+
if( cnt > 0) {
|
1212
|
+
var idrow = $("<tr class='FormData' style='display:none'><td class='CaptionTD'></td><td colspan='"+ (maxcols*2-1)+"' class='DataTD'><input class='FormElement' id='id_g' type='text' name='id' value='"+rowid+"'/></td></tr>");
|
1213
|
+
idrow[0].rp = cnt+99;
|
1214
|
+
$(tb).append(idrow);
|
1215
|
+
}
|
1216
|
+
return retpos;
|
1217
|
+
}
|
1218
|
+
function fillData(rowid,obj){
|
1219
|
+
var nm, hc,cnt=0,tmp, opt,trv;
|
1220
|
+
trv = $(obj).jqGrid("getInd",rowid,true);
|
1221
|
+
if(!trv) { return; }
|
1222
|
+
$('td',trv).each( function(i) {
|
1223
|
+
nm = obj.p.colModel[i].name;
|
1224
|
+
// hidden fields are included in the form
|
1225
|
+
if(obj.p.colModel[i].editrules && obj.p.colModel[i].editrules.edithidden === true) {
|
1226
|
+
hc = false;
|
1227
|
+
} else {
|
1228
|
+
hc = obj.p.colModel[i].hidden === true ? true : false;
|
1229
|
+
}
|
1230
|
+
if ( nm !== 'cb' && nm !== 'subgrid' && nm !== 'rn') {
|
1231
|
+
if(nm == obj.p.ExpandColumn && obj.p.treeGrid === true) {
|
1232
|
+
tmp = $(this).text();
|
1233
|
+
} else {
|
1234
|
+
tmp = $(this).html();
|
1235
|
+
}
|
1236
|
+
opt = $.extend({},obj.p.colModel[i].editoptions || {});
|
1237
|
+
nm = $.jgrid.jqID("v_"+nm);
|
1238
|
+
$("#"+nm+" span","#"+frmtb).html(tmp);
|
1239
|
+
if (hc) { $("#"+nm,"#"+frmtb).parents("tr:first").hide(); }
|
1240
|
+
cnt++;
|
1241
|
+
}
|
1242
|
+
});
|
1243
|
+
if(cnt>0) { $("#id_g","#"+frmtb).val(rowid); }
|
1244
|
+
}
|
1245
|
+
if ( $("#"+IDs.themodal).html() != null ) {
|
1246
|
+
if(onBeforeInit) {
|
1247
|
+
showFrm = onBeforeInit($("#"+frmgr));
|
1248
|
+
if(typeof(showFrm) == "undefined") {
|
1249
|
+
showFrm = true;
|
1250
|
+
}
|
1251
|
+
}
|
1252
|
+
if(showFrm === false) { return; }
|
1253
|
+
$(".ui-jqdialog-title","#"+IDs.modalhead).html(p.caption);
|
1254
|
+
$("#FormError","#"+frmtb).hide();
|
1255
|
+
fillData(rowid,$t);
|
1256
|
+
if($.isFunction(p.beforeShowForm)) { p.beforeShowForm($("#"+frmgr)); }
|
1257
|
+
$.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal, jqM: false, overlay: p.overlay, modal:p.modal});
|
1258
|
+
focusaref();
|
1259
|
+
} else {
|
1260
|
+
var dh = isNaN(p.dataheight) ? p.dataheight : p.dataheight+"px";
|
1261
|
+
var frm = $("<form name='FormPost' id='"+frmgr+"' class='FormGrid' style='width:100%;overflow:auto;position:relative;height:"+dh+";'></form>"),
|
1262
|
+
tbl =$("<table id='"+frmtb+"' class='EditTable' cellspacing='1' cellpadding='2' border='0' style='table-layout:fixed'><tbody></tbody></table>");
|
1263
|
+
if(onBeforeInit) {
|
1264
|
+
showFrm = onBeforeInit($("#"+frmgr));
|
1265
|
+
if(typeof(showFrm) == "undefined") {
|
1266
|
+
showFrm = true;
|
1267
|
+
}
|
1268
|
+
}
|
1269
|
+
if(showFrm === false) { return; }
|
1270
|
+
$($t.p.colModel).each( function(i) {
|
1271
|
+
var fmto = this.formoptions;
|
1272
|
+
maxCols = Math.max(maxCols, fmto ? fmto.colpos || 0 : 0 );
|
1273
|
+
maxRows = Math.max(maxRows, fmto ? fmto.rowpos || 0 : 0 );
|
1274
|
+
});
|
1275
|
+
// set the id.
|
1276
|
+
$(frm).append(tbl);
|
1277
|
+
createData(rowid, $t, tbl, maxCols);
|
1278
|
+
var rtlb = $t.p.direction == "rtl" ? true :false,
|
1279
|
+
bp = rtlb ? "nData" : "pData",
|
1280
|
+
bn = rtlb ? "pData" : "nData",
|
1281
|
+
|
1282
|
+
// buttons at footer
|
1283
|
+
bP = "<a href='javascript:void(0)' id='"+bp+"' class='fm-button ui-state-default ui-corner-left'><span class='ui-icon ui-icon-triangle-1-w'></span></a>",
|
1284
|
+
bN = "<a href='javascript:void(0)' id='"+bn+"' class='fm-button ui-state-default ui-corner-right'><span class='ui-icon ui-icon-triangle-1-e'></span></a>",
|
1285
|
+
bC ="<a href='javascript:void(0)' id='cData' class='fm-button ui-state-default ui-corner-all'>"+p.bClose+"</a>";
|
1286
|
+
if(maxRows > 0) {
|
1287
|
+
var sd=[];
|
1288
|
+
$.each($(tbl)[0].rows,function(i,r){
|
1289
|
+
sd[i] = r;
|
1290
|
+
});
|
1291
|
+
sd.sort(function(a,b){
|
1292
|
+
if(a.rp > b.rp) {return 1;}
|
1293
|
+
if(a.rp < b.rp) {return -1;}
|
1294
|
+
return 0;
|
1295
|
+
});
|
1296
|
+
$.each(sd, function(index, row) {
|
1297
|
+
$('tbody',tbl).append(row);
|
1298
|
+
});
|
1299
|
+
}
|
1300
|
+
p.gbox = "#gbox_"+gID;
|
1301
|
+
var cle = false;
|
1302
|
+
if(p.closeOnEscape===true){
|
1303
|
+
p.closeOnEscape = false;
|
1304
|
+
cle = true;
|
1305
|
+
}
|
1306
|
+
var bt = $("<span></span>").append(frm).append("<table border='0' class='EditTable' id='"+frmtb+"_2'><tbody><tr id='Act_Buttons'><td class='navButton' width='"+p.labelswidth+"'>"+(rtlb ? bN+bP : bP+bN)+"</td><td class='EditButton'>"+bC+"</td></tr></tbody></table>");
|
1307
|
+
$.jgrid.createModal(IDs,bt,p,"#gview_"+$t.p.id,$("#gview_"+$t.p.id)[0]);
|
1308
|
+
if(rtlb) {
|
1309
|
+
$("#pData, #nData","#"+frmtb+"_2").css("float","right");
|
1310
|
+
$(".EditButton","#"+frmtb+"_2").css("text-align","left");
|
1311
|
+
}
|
1312
|
+
if(!p.viewPagerButtons) { $("#pData, #nData","#"+frmtb+"_2").hide(); }
|
1313
|
+
bt = null;
|
1314
|
+
$("#"+IDs.themodal).keydown( function( e ) {
|
1315
|
+
if(e.which === 27) {
|
1316
|
+
if(cle) { $.jgrid.hideModal(this,{gb:p.gbox,jqm:p.jqModal, onClose: p.onClose}); }
|
1317
|
+
return false;
|
1318
|
+
}
|
1319
|
+
if(p.navkeys[0]===true) {
|
1320
|
+
if(e.which === p.navkeys[1]){ //up
|
1321
|
+
$("#pData", "#"+frmtb+"_2").trigger("click");
|
1322
|
+
return false;
|
1323
|
+
}
|
1324
|
+
if(e.which === p.navkeys[2]){ //down
|
1325
|
+
$("#nData", "#"+frmtb+"_2").trigger("click");
|
1326
|
+
return false;
|
1327
|
+
}
|
1328
|
+
}
|
1329
|
+
});
|
1330
|
+
p.closeicon = $.extend([true,"left","ui-icon-close"],p.closeicon);
|
1331
|
+
if(p.closeicon[0]===true) {
|
1332
|
+
$("#cData","#"+frmtb+"_2").addClass(p.closeicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
|
1333
|
+
.append("<span class='ui-icon "+p.closeicon[2]+"'></span>");
|
1334
|
+
}
|
1335
|
+
if($.isFunction(p.beforeShowForm)) { p.beforeShowForm($("#"+frmgr)); }
|
1336
|
+
$.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal, modal:p.modal});
|
1337
|
+
$(".fm-button:not(.ui-state-disabled)","#"+frmtb+"_2").hover(
|
1338
|
+
function(){$(this).addClass('ui-state-hover');},
|
1339
|
+
function(){$(this).removeClass('ui-state-hover');}
|
1340
|
+
);
|
1341
|
+
focusaref();
|
1342
|
+
$("#cData", "#"+frmtb+"_2").click(function(e){
|
1343
|
+
$.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: p.onClose});
|
1344
|
+
return false;
|
1345
|
+
});
|
1346
|
+
$("#nData", "#"+frmtb+"_2").click(function(e){
|
1347
|
+
$("#FormError","#"+frmtb).hide();
|
1348
|
+
var npos = getCurrPos();
|
1349
|
+
npos[0] = parseInt(npos[0],10);
|
1350
|
+
if(npos[0] != -1 && npos[1][npos[0]+1]) {
|
1351
|
+
if($.isFunction(p.onclickPgButtons)) {
|
1352
|
+
p.onclickPgButtons('next',$("#"+frmgr),npos[1][npos[0]]);
|
1353
|
+
}
|
1354
|
+
fillData(npos[1][npos[0]+1],$t);
|
1355
|
+
$($t).jqGrid("setSelection",npos[1][npos[0]+1]);
|
1356
|
+
if($.isFunction(p.afterclickPgButtons)) {
|
1357
|
+
p.afterclickPgButtons('next',$("#"+frmgr),npos[1][npos[0]+1]);
|
1358
|
+
}
|
1359
|
+
updateNav(npos[0]+1,npos[1].length-1);
|
1360
|
+
}
|
1361
|
+
focusaref();
|
1362
|
+
return false;
|
1363
|
+
});
|
1364
|
+
$("#pData", "#"+frmtb+"_2").click(function(e){
|
1365
|
+
$("#FormError","#"+frmtb).hide();
|
1366
|
+
var ppos = getCurrPos();
|
1367
|
+
if(ppos[0] != -1 && ppos[1][ppos[0]-1]) {
|
1368
|
+
if($.isFunction(p.onclickPgButtons)) {
|
1369
|
+
p.onclickPgButtons('prev',$("#"+frmgr),ppos[1][ppos[0]]);
|
1370
|
+
}
|
1371
|
+
fillData(ppos[1][ppos[0]-1],$t);
|
1372
|
+
$($t).jqGrid("setSelection",ppos[1][ppos[0]-1]);
|
1373
|
+
if($.isFunction(p.afterclickPgButtons)) {
|
1374
|
+
p.afterclickPgButtons('prev',$("#"+frmgr),ppos[1][ppos[0]-1]);
|
1375
|
+
}
|
1376
|
+
updateNav(ppos[0]-1,ppos[1].length-1);
|
1377
|
+
}
|
1378
|
+
focusaref();
|
1379
|
+
return false;
|
1380
|
+
});
|
1381
|
+
}
|
1382
|
+
function updateNav(cr,totr,rid){
|
1383
|
+
if (cr===0) { $("#pData","#"+frmtb+"_2").addClass('ui-state-disabled'); } else { $("#pData","#"+frmtb+"_2").removeClass('ui-state-disabled'); }
|
1384
|
+
if (cr==totr) { $("#nData","#"+frmtb+"_2").addClass('ui-state-disabled'); } else { $("#nData","#"+frmtb+"_2").removeClass('ui-state-disabled'); }
|
1385
|
+
}
|
1386
|
+
function getCurrPos() {
|
1387
|
+
var rowsInGrid = $($t).jqGrid("getDataIDs"),
|
1388
|
+
selrow = $("#id_g","#"+frmtb).val(),
|
1389
|
+
pos = $.inArray(selrow,rowsInGrid);
|
1390
|
+
return [pos,rowsInGrid];
|
1391
|
+
}
|
1392
|
+
|
1393
|
+
var posInit =getCurrPos();
|
1394
|
+
updateNav(posInit[0],posInit[1].length-1);
|
1395
|
+
});
|
1396
|
+
},
|
1397
|
+
delGridRow : function(rowids,p) {
|
1398
|
+
p = $.extend({
|
1399
|
+
top : 0,
|
1400
|
+
left: 0,
|
1401
|
+
width: 240,
|
1402
|
+
height: 'auto',
|
1403
|
+
dataheight : 'auto',
|
1404
|
+
modal: false,
|
1405
|
+
overlay: 10,
|
1406
|
+
drag: true,
|
1407
|
+
resize: true,
|
1408
|
+
url : '',
|
1409
|
+
mtype : "POST",
|
1410
|
+
reloadAfterSubmit: true,
|
1411
|
+
beforeShowForm: null,
|
1412
|
+
beforeInitData : null,
|
1413
|
+
afterShowForm: null,
|
1414
|
+
beforeSubmit: null,
|
1415
|
+
onclickSubmit: null,
|
1416
|
+
afterSubmit: null,
|
1417
|
+
jqModal : true,
|
1418
|
+
closeOnEscape : false,
|
1419
|
+
delData: {},
|
1420
|
+
delicon : [],
|
1421
|
+
cancelicon : [],
|
1422
|
+
onClose : null,
|
1423
|
+
ajaxDelOptions : {},
|
1424
|
+
processing : false,
|
1425
|
+
serializeDelData : null,
|
1426
|
+
useDataProxy : false
|
1427
|
+
}, $.jgrid.del, p ||{});
|
1428
|
+
rp_ge = p;
|
1429
|
+
return this.each(function(){
|
1430
|
+
var $t = this;
|
1431
|
+
if (!$t.grid ) { return; }
|
1432
|
+
if(!rowids) { return; }
|
1433
|
+
var onBeforeShow = typeof p.beforeShowForm === 'function' ? true: false,
|
1434
|
+
onAfterShow = typeof p.afterShowForm === 'function' ? true: false,
|
1435
|
+
onBeforeInit = $.isFunction(p.beforeInitData) ? p.beforeInitData : false,
|
1436
|
+
gID = $t.p.id, onCS = {},
|
1437
|
+
showFrm = true,
|
1438
|
+
dtbl = "DelTbl_"+gID,postd, idname, opers, oper,
|
1439
|
+
IDs = {themodal:'delmod'+gID,modalhead:'delhd'+gID,modalcontent:'delcnt'+gID, scrollelm: dtbl};
|
1440
|
+
if (jQuery.isArray(rowids)) { rowids = rowids.join(); }
|
1441
|
+
if ( $("#"+IDs.themodal).html() != null ) {
|
1442
|
+
if(onBeforeInit) {
|
1443
|
+
showFrm = onBeforeInit();
|
1444
|
+
if(typeof(showFrm) == "undefined") {
|
1445
|
+
showFrm = true;
|
1446
|
+
}
|
1447
|
+
}
|
1448
|
+
if(showFrm === false) { return; }
|
1449
|
+
$("#DelData>td","#"+dtbl).text(rowids);
|
1450
|
+
$("#DelError","#"+dtbl).hide();
|
1451
|
+
if( rp_ge.processing === true) {
|
1452
|
+
rp_ge.processing=false;
|
1453
|
+
$("#dData", "#"+dtbl).removeClass('ui-state-active');
|
1454
|
+
}
|
1455
|
+
if(onBeforeShow) { p.beforeShowForm($("#"+dtbl)); }
|
1456
|
+
$.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal,jqM: false, overlay: p.overlay, modal:p.modal});
|
1457
|
+
if(onAfterShow) { p.afterShowForm($("#"+dtbl)); }
|
1458
|
+
} else {
|
1459
|
+
if(onBeforeInit) {
|
1460
|
+
showFrm = onBeforeInit();
|
1461
|
+
if(typeof(showFrm) == "undefined") {
|
1462
|
+
showFrm = true;
|
1463
|
+
}
|
1464
|
+
}
|
1465
|
+
if(showFrm === false) { return; }
|
1466
|
+
var dh = isNaN(p.dataheight) ? p.dataheight : p.dataheight+"px";
|
1467
|
+
var tbl = "<div id='"+dtbl+"' class='formdata' style='width:100%;overflow:auto;position:relative;height:"+dh+";'>";
|
1468
|
+
tbl += "<table class='DelTable'><tbody>";
|
1469
|
+
// error data
|
1470
|
+
tbl += "<tr id='DelError' style='display:none'><td class='ui-state-error'></td></tr>";
|
1471
|
+
tbl += "<tr id='DelData' style='display:none'><td >"+rowids+"</td></tr>";
|
1472
|
+
tbl += "<tr><td class=\"delmsg\" style=\"white-space:pre;\">"+p.msg+"</td></tr><tr><td > </td></tr>";
|
1473
|
+
// buttons at footer
|
1474
|
+
tbl += "</tbody></table></div>";
|
1475
|
+
var bS = "<a href='javascript:void(0)' id='dData' class='fm-button ui-state-default ui-corner-all'>"+p.bSubmit+"</a>",
|
1476
|
+
bC = "<a href='javascript:void(0)' id='eData' class='fm-button ui-state-default ui-corner-all'>"+p.bCancel+"</a>";
|
1477
|
+
tbl += "<table cellspacing='0' cellpadding='0' border='0' class='EditTable' id='"+dtbl+"_2'><tbody><tr><td><hr class='ui-widget-content' style='margin:1px'/></td></tr></tr><tr><td class='DelButton EditButton'>"+bS+" "+bC+"</td></tr></tbody></table>";
|
1478
|
+
p.gbox = "#gbox_"+gID;
|
1479
|
+
$.jgrid.createModal(IDs,tbl,p,"#gview_"+$t.p.id,$("#gview_"+$t.p.id)[0]);
|
1480
|
+
$(".fm-button","#"+dtbl+"_2").hover(
|
1481
|
+
function(){$(this).addClass('ui-state-hover');},
|
1482
|
+
function(){$(this).removeClass('ui-state-hover');}
|
1483
|
+
);
|
1484
|
+
p.delicon = $.extend([true,"left","ui-icon-scissors"],p.delicon);
|
1485
|
+
p.cancelicon = $.extend([true,"left","ui-icon-cancel"],p.cancelicon);
|
1486
|
+
if(p.delicon[0]===true) {
|
1487
|
+
$("#dData","#"+dtbl+"_2").addClass(p.delicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
|
1488
|
+
.append("<span class='ui-icon "+p.delicon[2]+"'></span>");
|
1489
|
+
}
|
1490
|
+
if(p.cancelicon[0]===true) {
|
1491
|
+
$("#eData","#"+dtbl+"_2").addClass(p.cancelicon[1] == "right" ? 'fm-button-icon-right' : 'fm-button-icon-left')
|
1492
|
+
.append("<span class='ui-icon "+p.cancelicon[2]+"'></span>");
|
1493
|
+
}
|
1494
|
+
$("#dData","#"+dtbl+"_2").click(function(e){
|
1495
|
+
var ret=[true,""]; onCS = {};
|
1496
|
+
var postdata = $("#DelData>td","#"+dtbl).text(); //the pair is name=val1,val2,...
|
1497
|
+
if( typeof p.onclickSubmit === 'function' ) { onCS = p.onclickSubmit(rp_ge, postdata) || {}; }
|
1498
|
+
if( typeof p.beforeSubmit === 'function' ) { ret = p.beforeSubmit(postdata); }
|
1499
|
+
if(ret[0] && !rp_ge.processing) {
|
1500
|
+
rp_ge.processing = true;
|
1501
|
+
$(this).addClass('ui-state-active');
|
1502
|
+
opers = $t.p.prmNames;
|
1503
|
+
postd = $.extend({},rp_ge.delData, onCS);
|
1504
|
+
oper = opers.oper;
|
1505
|
+
postd[oper] = opers.deloper;
|
1506
|
+
idname = opers.id;
|
1507
|
+
postd[idname] = postdata;
|
1508
|
+
|
1509
|
+
var ajaxOptions = $.extend({
|
1510
|
+
url: rp_ge.url ? rp_ge.url : $($t).jqGrid('getGridParam','editurl'),
|
1511
|
+
type: p.mtype,
|
1512
|
+
data: $.isFunction(p.serializeDelData) ? p.serializeDelData(postd) : postd,
|
1513
|
+
complete:function(data,Status){
|
1514
|
+
if(Status != "success") {
|
1515
|
+
ret[0] = false;
|
1516
|
+
if ($.isFunction(rp_ge.errorTextFormat)) {
|
1517
|
+
ret[1] = rp_ge.errorTextFormat(data);
|
1518
|
+
} else {
|
1519
|
+
ret[1] = Status + " Status: '" + data.statusText + "'. Error code: " + data.status;
|
1520
|
+
}
|
1521
|
+
} else {
|
1522
|
+
// data is posted successful
|
1523
|
+
// execute aftersubmit with the returned data from server
|
1524
|
+
if( typeof rp_ge.afterSubmit === 'function' ) {
|
1525
|
+
ret = rp_ge.afterSubmit(data,postd);
|
1526
|
+
}
|
1527
|
+
}
|
1528
|
+
if(ret[0] === false) {
|
1529
|
+
$("#DelError>td","#"+dtbl).html(ret[1]);
|
1530
|
+
$("#DelError","#"+dtbl).show();
|
1531
|
+
} else {
|
1532
|
+
if(rp_ge.reloadAfterSubmit && $t.p.datatype != "local") {
|
1533
|
+
$($t).trigger("reloadGrid");
|
1534
|
+
} else {
|
1535
|
+
var toarr = [];
|
1536
|
+
toarr = postdata.split(",");
|
1537
|
+
if($t.p.treeGrid===true){
|
1538
|
+
try {$($t).jqGrid("delTreeNode",toarr[0]);} catch(e){}
|
1539
|
+
} else {
|
1540
|
+
for(var i=0;i<toarr.length;i++) {
|
1541
|
+
$($t).jqGrid("delRowData",toarr[i]);
|
1542
|
+
}
|
1543
|
+
}
|
1544
|
+
$t.p.selrow = null;
|
1545
|
+
$t.p.selarrrow = [];
|
1546
|
+
}
|
1547
|
+
if($.isFunction(rp_ge.afterComplete)) {
|
1548
|
+
setTimeout(function(){rp_ge.afterComplete(data,postdata);},500);
|
1549
|
+
}
|
1550
|
+
}
|
1551
|
+
rp_ge.processing=false;
|
1552
|
+
$("#dData", "#"+dtbl+"_2").removeClass('ui-state-active');
|
1553
|
+
if(ret[0]) { $.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: rp_ge.onClose}); }
|
1554
|
+
},
|
1555
|
+
error:function(xhr,st,err){
|
1556
|
+
$("#DelError>td","#"+dtbl).html(st+ " : "+err);
|
1557
|
+
$("#DelError","#"+dtbl).show();
|
1558
|
+
rp_ge.processing=false;
|
1559
|
+
$("#dData", "#"+dtbl+"_2").removeClass('ui-state-active');
|
1560
|
+
}
|
1561
|
+
}, $.jgrid.ajaxOptions, p.ajaxDelOptions);
|
1562
|
+
|
1563
|
+
|
1564
|
+
if (!ajaxOptions.url && !rp_ge.useDataProxy) {
|
1565
|
+
if ($.isFunction($t.p.dataProxy)) {
|
1566
|
+
rp_ge.useDataProxy = true;
|
1567
|
+
} else {
|
1568
|
+
ret[0]=false; ret[1] += " "+$.jgrid.errors.nourl;
|
1569
|
+
}
|
1570
|
+
}
|
1571
|
+
if (ret[0]) {
|
1572
|
+
if (rp_ge.useDataProxy) { $t.p.dataProxy.call($t, ajaxOptions, "del_"+$t.p.id); }
|
1573
|
+
else { $.ajax(ajaxOptions); }
|
1574
|
+
}
|
1575
|
+
}
|
1576
|
+
|
1577
|
+
if(ret[0] === false) {
|
1578
|
+
$("#DelError>td","#"+dtbl).html(ret[1]);
|
1579
|
+
$("#DelError","#"+dtbl).show();
|
1580
|
+
}
|
1581
|
+
return false;
|
1582
|
+
});
|
1583
|
+
$("#eData", "#"+dtbl+"_2").click(function(e){
|
1584
|
+
$.jgrid.hideModal("#"+IDs.themodal,{gb:"#gbox_"+gID,jqm:p.jqModal, onClose: rp_ge.onClose});
|
1585
|
+
return false;
|
1586
|
+
});
|
1587
|
+
if(onBeforeShow) { p.beforeShowForm($("#"+dtbl)); }
|
1588
|
+
$.jgrid.viewModal("#"+IDs.themodal,{gbox:"#gbox_"+gID,jqm:p.jqModal, overlay: p.overlay, modal:p.modal});
|
1589
|
+
if(onAfterShow) { p.afterShowForm($("#"+dtbl)); }
|
1590
|
+
}
|
1591
|
+
if(p.closeOnEscape===true) {
|
1592
|
+
setTimeout(function(){$(".ui-jqdialog-titlebar-close","#"+IDs.modalhead).focus();},0);
|
1593
|
+
}
|
1594
|
+
});
|
1595
|
+
},
|
1596
|
+
navGrid : function (elem, o, pEdit,pAdd,pDel,pSearch, pView) {
|
1597
|
+
o = $.extend({
|
1598
|
+
edit: true,
|
1599
|
+
editicon: "ui-icon-pencil",
|
1600
|
+
add: true,
|
1601
|
+
addicon:"ui-icon-plus",
|
1602
|
+
del: true,
|
1603
|
+
delicon:"ui-icon-trash",
|
1604
|
+
search: true,
|
1605
|
+
searchicon:"ui-icon-search",
|
1606
|
+
refresh: true,
|
1607
|
+
refreshicon:"ui-icon-refresh",
|
1608
|
+
refreshstate: 'firstpage',
|
1609
|
+
view: false,
|
1610
|
+
viewicon : "ui-icon-document",
|
1611
|
+
position : "left",
|
1612
|
+
closeOnEscape : true,
|
1613
|
+
beforeRefresh : null,
|
1614
|
+
afterRefresh : null,
|
1615
|
+
cloneToTop : false
|
1616
|
+
}, $.jgrid.nav, o ||{});
|
1617
|
+
return this.each(function() {
|
1618
|
+
var alertIDs = {themodal:'alertmod',modalhead:'alerthd',modalcontent:'alertcnt'},
|
1619
|
+
$t = this, vwidth, vheight, twd, tdw;
|
1620
|
+
if(!$t.grid || typeof elem != 'string') { return; }
|
1621
|
+
if ($("#"+alertIDs.themodal).html() === null) {
|
1622
|
+
if (typeof window.innerWidth != 'undefined') {
|
1623
|
+
vwidth = window.innerWidth;
|
1624
|
+
vheight = window.innerHeight;
|
1625
|
+
} else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth !== 0) {
|
1626
|
+
vwidth = document.documentElement.clientWidth;
|
1627
|
+
vheight = document.documentElement.clientHeight;
|
1628
|
+
} else {
|
1629
|
+
vwidth=1024;
|
1630
|
+
vheight=768;
|
1631
|
+
}
|
1632
|
+
$.jgrid.createModal(alertIDs,"<div>"+o.alerttext+"</div><span tabindex='0'><span tabindex='-1' id='jqg_alrt'></span></span>",{gbox:"#gbox_"+$t.p.id,jqModal:true,drag:true,resize:true,caption:o.alertcap,top:vheight/2-25,left:vwidth/2-100,width:200,height:'auto',closeOnEscape:o.closeOnEscape},"","",true);
|
1633
|
+
}
|
1634
|
+
var clone = 1;
|
1635
|
+
if(o.cloneToTop && $t.p.toppager) { clone = 2; }
|
1636
|
+
for(var i = 0; i<clone; i++) {
|
1637
|
+
var tbd,
|
1638
|
+
navtbl = $("<table cellspacing='0' cellpadding='0' border='0' class='ui-pg-table navtable' style='float:left;table-layout:auto;'><tbody><tr></tr></tbody></table>"),
|
1639
|
+
sep = "<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='ui-separator'></span></td>",
|
1640
|
+
pgid, elemids;
|
1641
|
+
if(i===0) {
|
1642
|
+
pgid = elem;
|
1643
|
+
elemids = $t.p.id;
|
1644
|
+
if(pgid == $t.p.toppager) {
|
1645
|
+
elemids += "_top";
|
1646
|
+
clone = 1;
|
1647
|
+
}
|
1648
|
+
} else {
|
1649
|
+
pgid = $t.p.toppager;
|
1650
|
+
elemids = $t.p.id+"_top";
|
1651
|
+
}
|
1652
|
+
if($t.p.direction == "rtl") { $(navtbl).attr("dir","rtl").css("float","right"); }
|
1653
|
+
if (o.add) {
|
1654
|
+
pAdd = pAdd || {};
|
1655
|
+
tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
|
1656
|
+
$(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.addicon+"'></span>"+o.addtext+"</div>");
|
1657
|
+
$("tr",navtbl).append(tbd);
|
1658
|
+
$(tbd,navtbl)
|
1659
|
+
.attr({"title":o.addtitle || "",id : pAdd.id || "add_"+elemids})
|
1660
|
+
.click(function(){
|
1661
|
+
if (!$(this).hasClass('ui-state-disabled')) {
|
1662
|
+
if (typeof o.addfunc == 'function') {
|
1663
|
+
o.addfunc();
|
1664
|
+
} else {
|
1665
|
+
$($t).jqGrid("editGridRow","new",pAdd);
|
1666
|
+
}
|
1667
|
+
}
|
1668
|
+
return false;
|
1669
|
+
}).hover(
|
1670
|
+
function () {
|
1671
|
+
if (!$(this).hasClass('ui-state-disabled')) {
|
1672
|
+
$(this).addClass("ui-state-hover");
|
1673
|
+
}
|
1674
|
+
},
|
1675
|
+
function () {$(this).removeClass("ui-state-hover");}
|
1676
|
+
);
|
1677
|
+
tbd = null;
|
1678
|
+
}
|
1679
|
+
if (o.edit) {
|
1680
|
+
tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
|
1681
|
+
pEdit = pEdit || {};
|
1682
|
+
$(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.editicon+"'></span>"+o.edittext+"</div>");
|
1683
|
+
$("tr",navtbl).append(tbd);
|
1684
|
+
$(tbd,navtbl)
|
1685
|
+
.attr({"title":o.edittitle || "",id: pEdit.id || "edit_"+elemids})
|
1686
|
+
.click(function(){
|
1687
|
+
if (!$(this).hasClass('ui-state-disabled')) {
|
1688
|
+
var sr = $t.p.selrow;
|
1689
|
+
if (sr) {
|
1690
|
+
if(typeof o.editfunc == 'function') {
|
1691
|
+
o.editfunc(sr);
|
1692
|
+
} else {
|
1693
|
+
$($t).jqGrid("editGridRow",sr,pEdit);
|
1694
|
+
}
|
1695
|
+
} else {
|
1696
|
+
$.jgrid.viewModal("#"+alertIDs.themodal,{gbox:"#gbox_"+$t.p.id,jqm:true});
|
1697
|
+
$("#jqg_alrt").focus();
|
1698
|
+
}
|
1699
|
+
}
|
1700
|
+
return false;
|
1701
|
+
}).hover(
|
1702
|
+
function () {
|
1703
|
+
if (!$(this).hasClass('ui-state-disabled')) {
|
1704
|
+
$(this).addClass("ui-state-hover");
|
1705
|
+
}
|
1706
|
+
},
|
1707
|
+
function () {$(this).removeClass("ui-state-hover");}
|
1708
|
+
);
|
1709
|
+
tbd = null;
|
1710
|
+
}
|
1711
|
+
if (o.view) {
|
1712
|
+
tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
|
1713
|
+
pView = pView || {};
|
1714
|
+
$(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.viewicon+"'></span>"+o.viewtext+"</div>");
|
1715
|
+
$("tr",navtbl).append(tbd);
|
1716
|
+
$(tbd,navtbl)
|
1717
|
+
.attr({"title":o.viewtitle || "",id: pView.id || "view_"+elemids})
|
1718
|
+
.click(function(){
|
1719
|
+
if (!$(this).hasClass('ui-state-disabled')) {
|
1720
|
+
var sr = $t.p.selrow;
|
1721
|
+
if (sr) {
|
1722
|
+
$($t).jqGrid("viewGridRow",sr,pView);
|
1723
|
+
} else {
|
1724
|
+
$.jgrid.viewModal("#"+alertIDs.themodal,{gbox:"#gbox_"+$t.p.id,jqm:true});
|
1725
|
+
$("#jqg_alrt").focus();
|
1726
|
+
}
|
1727
|
+
}
|
1728
|
+
return false;
|
1729
|
+
}).hover(
|
1730
|
+
function () {
|
1731
|
+
if (!$(this).hasClass('ui-state-disabled')) {
|
1732
|
+
$(this).addClass("ui-state-hover");
|
1733
|
+
}
|
1734
|
+
},
|
1735
|
+
function () {$(this).removeClass("ui-state-hover");}
|
1736
|
+
);
|
1737
|
+
tbd = null;
|
1738
|
+
}
|
1739
|
+
if (o.del) {
|
1740
|
+
tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
|
1741
|
+
pDel = pDel || {};
|
1742
|
+
$(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.delicon+"'></span>"+o.deltext+"</div>");
|
1743
|
+
$("tr",navtbl).append(tbd);
|
1744
|
+
$(tbd,navtbl)
|
1745
|
+
.attr({"title":o.deltitle || "",id: pDel.id || "del_"+elemids})
|
1746
|
+
.click(function(){
|
1747
|
+
if (!$(this).hasClass('ui-state-disabled')) {
|
1748
|
+
var dr;
|
1749
|
+
if($t.p.multiselect) {
|
1750
|
+
dr = $t.p.selarrrow;
|
1751
|
+
if(dr.length===0) { dr = null; }
|
1752
|
+
} else {
|
1753
|
+
dr = $t.p.selrow;
|
1754
|
+
}
|
1755
|
+
if(dr){
|
1756
|
+
if("function" == typeof o.delfunc){
|
1757
|
+
o.delfunc(dr);
|
1758
|
+
}else{
|
1759
|
+
$($t).jqGrid("delGridRow",dr,pDel);
|
1760
|
+
}
|
1761
|
+
} else {
|
1762
|
+
$.jgrid.viewModal("#"+alertIDs.themodal,{gbox:"#gbox_"+$t.p.id,jqm:true}); $("#jqg_alrt").focus();
|
1763
|
+
}
|
1764
|
+
}
|
1765
|
+
return false;
|
1766
|
+
}).hover(
|
1767
|
+
function () {
|
1768
|
+
if (!$(this).hasClass('ui-state-disabled')) {
|
1769
|
+
$(this).addClass("ui-state-hover");
|
1770
|
+
}
|
1771
|
+
},
|
1772
|
+
function () {$(this).removeClass("ui-state-hover");}
|
1773
|
+
);
|
1774
|
+
tbd = null;
|
1775
|
+
}
|
1776
|
+
if(o.add || o.edit || o.del || o.view) { $("tr",navtbl).append(sep); }
|
1777
|
+
if (o.search) {
|
1778
|
+
tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
|
1779
|
+
pSearch = pSearch || {};
|
1780
|
+
$(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.searchicon+"'></span>"+o.searchtext+"</div>");
|
1781
|
+
$("tr",navtbl).append(tbd);
|
1782
|
+
$(tbd,navtbl)
|
1783
|
+
.attr({"title":o.searchtitle || "",id:pSearch.id || "search_"+elemids})
|
1784
|
+
.click(function(){
|
1785
|
+
if (!$(this).hasClass('ui-state-disabled')) {
|
1786
|
+
$($t).jqGrid("searchGrid",pSearch);
|
1787
|
+
}
|
1788
|
+
return false;
|
1789
|
+
}).hover(
|
1790
|
+
function () {
|
1791
|
+
if (!$(this).hasClass('ui-state-disabled')) {
|
1792
|
+
$(this).addClass("ui-state-hover");
|
1793
|
+
}
|
1794
|
+
},
|
1795
|
+
function () {$(this).removeClass("ui-state-hover");}
|
1796
|
+
);
|
1797
|
+
tbd = null;
|
1798
|
+
}
|
1799
|
+
if (o.refresh) {
|
1800
|
+
tbd = $("<td class='ui-pg-button ui-corner-all'></td>");
|
1801
|
+
$(tbd).append("<div class='ui-pg-div'><span class='ui-icon "+o.refreshicon+"'></span>"+o.refreshtext+"</div>");
|
1802
|
+
$("tr",navtbl).append(tbd);
|
1803
|
+
$(tbd,navtbl)
|
1804
|
+
.attr({"title":o.refreshtitle || "",id: "refresh_"+elemids})
|
1805
|
+
.click(function(){
|
1806
|
+
if (!$(this).hasClass('ui-state-disabled')) {
|
1807
|
+
if($.isFunction(o.beforeRefresh)) { o.beforeRefresh(); }
|
1808
|
+
$t.p.search = false;
|
1809
|
+
try {
|
1810
|
+
var gID = $t.p.id;
|
1811
|
+
$("#fbox_"+gID).searchFilter().reset({"reload":false});
|
1812
|
+
if($.isFunction($t.clearToolbar)) { $t.clearToolbar(false); }
|
1813
|
+
} catch (e) {}
|
1814
|
+
switch (o.refreshstate) {
|
1815
|
+
case 'firstpage':
|
1816
|
+
$($t).trigger("reloadGrid", [{page:1}]);
|
1817
|
+
break;
|
1818
|
+
case 'current':
|
1819
|
+
$($t).trigger("reloadGrid", [{current:true}]);
|
1820
|
+
break;
|
1821
|
+
}
|
1822
|
+
if($.isFunction(o.afterRefresh)) { o.afterRefresh(); }
|
1823
|
+
}
|
1824
|
+
return false;
|
1825
|
+
}).hover(
|
1826
|
+
function () {
|
1827
|
+
if (!$(this).hasClass('ui-state-disabled')) {
|
1828
|
+
$(this).addClass("ui-state-hover");
|
1829
|
+
}
|
1830
|
+
},
|
1831
|
+
function () {$(this).removeClass("ui-state-hover");}
|
1832
|
+
);
|
1833
|
+
tbd = null;
|
1834
|
+
}
|
1835
|
+
tdw = $(".ui-jqgrid").css("font-size") || "11px";
|
1836
|
+
$('body').append("<div id='testpg2' class='ui-jqgrid ui-widget ui-widget-content' style='font-size:"+tdw+";visibility:hidden;' ></div>");
|
1837
|
+
twd = $(navtbl).clone().appendTo("#testpg2").width();
|
1838
|
+
$("#testpg2").remove();
|
1839
|
+
$(pgid+"_"+o.position,pgid).append(navtbl);
|
1840
|
+
if($t.p._nvtd) {
|
1841
|
+
if(twd > $t.p._nvtd[0] ) {
|
1842
|
+
$(pgid+"_"+o.position,pgid).width(twd);
|
1843
|
+
$t.p._nvtd[0] = twd;
|
1844
|
+
}
|
1845
|
+
$t.p._nvtd[1] = twd;
|
1846
|
+
}
|
1847
|
+
tdw =null; twd=null; navtbl =null;
|
1848
|
+
}
|
1849
|
+
});
|
1850
|
+
},
|
1851
|
+
navButtonAdd : function (elem, p) {
|
1852
|
+
p = $.extend({
|
1853
|
+
caption : "newButton",
|
1854
|
+
title: '',
|
1855
|
+
buttonicon : 'ui-icon-newwin',
|
1856
|
+
onClickButton: null,
|
1857
|
+
position : "last",
|
1858
|
+
cursor : 'pointer'
|
1859
|
+
}, p ||{});
|
1860
|
+
return this.each(function() {
|
1861
|
+
if( !this.grid) { return; }
|
1862
|
+
if( elem.indexOf("#") !== 0) { elem = "#"+elem; }
|
1863
|
+
var findnav = $(".navtable",elem)[0], $t = this;
|
1864
|
+
if (findnav) {
|
1865
|
+
var tbd = $("<td></td>");
|
1866
|
+
if(p.buttonicon.toString().toUpperCase() == "NONE") {
|
1867
|
+
$(tbd).addClass('ui-pg-button ui-corner-all').append("<div class='ui-pg-div'>"+p.caption+"</div>");
|
1868
|
+
} else {
|
1869
|
+
$(tbd).addClass('ui-pg-button ui-corner-all').append("<div class='ui-pg-div'><span class='ui-icon "+p.buttonicon+"'></span>"+p.caption+"</div>");
|
1870
|
+
}
|
1871
|
+
if(p.id) {$(tbd).attr("id",p.id);}
|
1872
|
+
if(p.position=='first'){
|
1873
|
+
if(findnav.rows[0].cells.length ===0 ) {
|
1874
|
+
$("tr",findnav).append(tbd);
|
1875
|
+
} else {
|
1876
|
+
$("tr td:eq(0)",findnav).before(tbd);
|
1877
|
+
}
|
1878
|
+
} else {
|
1879
|
+
$("tr",findnav).append(tbd);
|
1880
|
+
}
|
1881
|
+
$(tbd,findnav)
|
1882
|
+
.attr("title",p.title || "")
|
1883
|
+
.click(function(e){
|
1884
|
+
if (!$(this).hasClass('ui-state-disabled')) {
|
1885
|
+
if ($.isFunction(p.onClickButton) ) { p.onClickButton.call($t,e); }
|
1886
|
+
}
|
1887
|
+
return false;
|
1888
|
+
})
|
1889
|
+
.hover(
|
1890
|
+
function () {
|
1891
|
+
if (!$(this).hasClass('ui-state-disabled')) {
|
1892
|
+
$(this).addClass('ui-state-hover');
|
1893
|
+
}
|
1894
|
+
},
|
1895
|
+
function () {$(this).removeClass("ui-state-hover");}
|
1896
|
+
);
|
1897
|
+
}
|
1898
|
+
});
|
1899
|
+
},
|
1900
|
+
navSeparatorAdd:function (elem,p) {
|
1901
|
+
p = $.extend({
|
1902
|
+
sepclass : "ui-separator",
|
1903
|
+
sepcontent: ''
|
1904
|
+
}, p ||{});
|
1905
|
+
return this.each(function() {
|
1906
|
+
if( !this.grid) { return; }
|
1907
|
+
if( elem.indexOf("#") !== 0) { elem = "#"+elem; }
|
1908
|
+
var findnav = $(".navtable",elem)[0];
|
1909
|
+
if(findnav) {
|
1910
|
+
var sep = "<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='"+p.sepclass+"'></span>"+p.sepcontent+"</td>";
|
1911
|
+
$("tr",findnav).append(sep);
|
1912
|
+
}
|
1913
|
+
});
|
1914
|
+
},
|
1915
|
+
GridToForm : function( rowid, formid ) {
|
1916
|
+
return this.each(function(){
|
1917
|
+
var $t = this;
|
1918
|
+
if (!$t.grid) { return; }
|
1919
|
+
var rowdata = $($t).jqGrid("getRowData",rowid);
|
1920
|
+
if (rowdata) {
|
1921
|
+
for(var i in rowdata) {
|
1922
|
+
if ( $("[name="+i+"]",formid).is("input:radio") || $("[name="+i+"]",formid).is("input:checkbox")) {
|
1923
|
+
$("[name="+i+"]",formid).each( function() {
|
1924
|
+
if( $(this).val() == rowdata[i] ) {
|
1925
|
+
$(this).attr("checked","checked");
|
1926
|
+
} else {
|
1927
|
+
$(this).attr("checked","");
|
1928
|
+
}
|
1929
|
+
});
|
1930
|
+
} else {
|
1931
|
+
// this is very slow on big table and form.
|
1932
|
+
$("[name="+i+"]",formid).val(rowdata[i]);
|
1933
|
+
}
|
1934
|
+
}
|
1935
|
+
}
|
1936
|
+
});
|
1937
|
+
},
|
1938
|
+
FormToGrid : function(rowid, formid, mode, position){
|
1939
|
+
return this.each(function() {
|
1940
|
+
var $t = this;
|
1941
|
+
if(!$t.grid) { return; }
|
1942
|
+
if(!mode) { mode = 'set'; }
|
1943
|
+
if(!position) { position = 'first'; }
|
1944
|
+
var fields = $(formid).serializeArray();
|
1945
|
+
var griddata = {};
|
1946
|
+
$.each(fields, function(i, field){
|
1947
|
+
griddata[field.name] = field.value;
|
1948
|
+
});
|
1949
|
+
if(mode=='add') { $($t).jqGrid("addRowData",rowid,griddata, position); }
|
1950
|
+
else if(mode=='set') { $($t).jqGrid("setRowData",rowid,griddata); }
|
1951
|
+
});
|
1952
|
+
}
|
1953
|
+
});
|
1954
|
+
})(jQuery);
|