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,503 +1,504 @@
|
|
1
|
-
;(function($){
|
2
|
-
/*
|
3
|
-
**
|
4
|
-
* jqGrid addons using jQuery UI
|
5
|
-
* Author: Mark Williams
|
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
|
-
* depends on jQuery UI
|
10
|
-
**/
|
11
|
-
if ($.browser.msie && $.browser.version==8) {
|
12
|
-
$.expr[":"].hidden = function(elem) {
|
13
|
-
return elem.offsetWidth === 0 || elem.offsetHeight === 0 ||
|
14
|
-
elem.style.display == "none";
|
15
|
-
};
|
16
|
-
}
|
17
|
-
// requiere load multiselect before grid
|
18
|
-
$.jgrid._multiselect = false;
|
19
|
-
if($.ui) {
|
20
|
-
if ($.ui.multiselect ) {
|
21
|
-
if($.ui.multiselect.prototype._setSelected) {
|
22
|
-
var setSelected = $.ui.multiselect.prototype._setSelected;
|
23
|
-
$.ui.multiselect.prototype._setSelected = function(item,selected) {
|
24
|
-
var ret = setSelected.call(this,item,selected);
|
25
|
-
if (selected && this.selectedList) {
|
26
|
-
var elt = this.element;
|
27
|
-
this.selectedList.find('li').each(function() {
|
28
|
-
if ($(this).data('optionLink')) {
|
29
|
-
$(this).data('optionLink').remove().appendTo(elt);
|
30
|
-
}
|
31
|
-
});
|
32
|
-
}
|
33
|
-
return ret;
|
34
|
-
};
|
35
|
-
}
|
36
|
-
if($.ui.multiselect.prototype.destroy) {
|
37
|
-
$.ui.multiselect.prototype.destroy = function() {
|
38
|
-
this.element.show();
|
39
|
-
this.container.remove();
|
40
|
-
if ($.Widget === undefined) {
|
41
|
-
$.widget.prototype.destroy.apply(this, arguments);
|
42
|
-
} else {
|
43
|
-
$.Widget.prototype.destroy.apply(this, arguments);
|
44
|
-
}
|
45
|
-
};
|
46
|
-
}
|
47
|
-
$.jgrid._multiselect = true;
|
48
|
-
}
|
49
|
-
}
|
50
|
-
|
51
|
-
$.jgrid.extend({
|
52
|
-
sortableColumns : function (tblrow)
|
53
|
-
{
|
54
|
-
return this.each(function (){
|
55
|
-
var ts = this;
|
56
|
-
function start() {ts.p.disableClick = true;}
|
57
|
-
var sortable_opts = {
|
58
|
-
"tolerance" : "pointer",
|
59
|
-
"axis" : "x",
|
60
|
-
"scrollSensitivity": "1",
|
61
|
-
"items": '>th:not(:has(#jqgh_cb,#jqgh_rn,#jqgh_subgrid),:hidden)',
|
62
|
-
"placeholder": {
|
63
|
-
element: function(item) {
|
64
|
-
var el = $(document.createElement(item[0].nodeName))
|
65
|
-
.addClass(item[0].className+" ui-sortable-placeholder ui-state-highlight")
|
66
|
-
.removeClass("ui-sortable-helper")[0];
|
67
|
-
return el;
|
68
|
-
},
|
69
|
-
update: function(self, p) {
|
70
|
-
p.height(self.currentItem.innerHeight() - parseInt(self.currentItem.css('paddingTop')||0, 10) - parseInt(self.currentItem.css('paddingBottom')||0, 10));
|
71
|
-
p.width(self.currentItem.innerWidth() - parseInt(self.currentItem.css('paddingLeft')||0, 10) - parseInt(self.currentItem.css('paddingRight')||0, 10));
|
72
|
-
}
|
73
|
-
},
|
74
|
-
"update": function(event, ui) {
|
75
|
-
var p = $(ui.item).parent();
|
76
|
-
var th = $(">th", p);
|
77
|
-
var colModel = ts.p.colModel;
|
78
|
-
var cmMap = {};
|
79
|
-
$.each(colModel, function(i) { cmMap[this.name]=i; });
|
80
|
-
var permutation = [];
|
81
|
-
th.each(function(i) {
|
82
|
-
var id = $(">div", this).get(0).id.replace(/^jqgh_/, "");
|
83
|
-
if (id in cmMap) {
|
84
|
-
permutation.push(cmMap[id]);
|
85
|
-
}
|
86
|
-
});
|
87
|
-
|
88
|
-
$(ts).jqGrid("remapColumns",permutation, true, true);
|
89
|
-
if ($.isFunction(ts.p.sortable.update)) {
|
90
|
-
ts.p.sortable.update(permutation);
|
91
|
-
}
|
92
|
-
setTimeout(function(){ts.p.disableClick=false;}, 50);
|
93
|
-
}
|
94
|
-
};
|
95
|
-
if (ts.p.sortable.options) {
|
96
|
-
$.extend(sortable_opts, ts.p.sortable.options);
|
97
|
-
} else if ($.isFunction(ts.p.sortable)) {
|
98
|
-
ts.p.sortable = { "update" : ts.p.sortable };
|
99
|
-
}
|
100
|
-
if (sortable_opts.start) {
|
101
|
-
var s = sortable_opts.start;
|
102
|
-
sortable_opts.start = function(e,ui) {
|
103
|
-
start();
|
104
|
-
s.call(this,e,ui);
|
105
|
-
};
|
106
|
-
} else {
|
107
|
-
sortable_opts.start = start;
|
108
|
-
}
|
109
|
-
if (ts.p.sortable.exclude) {
|
110
|
-
sortable_opts.items += ":not("+ts.p.sortable.exclude+")";
|
111
|
-
}
|
112
|
-
tblrow.sortable(sortable_opts).data("sortable").floating = true;
|
113
|
-
});
|
114
|
-
},
|
115
|
-
columnChooser : function(opts) {
|
116
|
-
var self = this;
|
117
|
-
if($("#colchooser_"+self[0].p.id).length ) { return; }
|
118
|
-
var selector = $('<div id="colchooser_'+self[0].p.id+'" style="position:relative;overflow:hidden"><div><select multiple="multiple"></select></div></div>');
|
119
|
-
var select = $('select', selector);
|
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
|
-
|
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
|
-
function call(fn, obj) {
|
256
|
-
if (!fn) { return; }
|
257
|
-
if (typeof fn == 'string') {
|
258
|
-
if ($.fn[fn]) {
|
259
|
-
$.fn[fn].apply(obj, $.makeArray(arguments).slice(2));
|
260
|
-
}
|
261
|
-
} else if ($.isFunction(fn)) {
|
262
|
-
fn.apply(obj, $.makeArray(arguments).slice(2));
|
263
|
-
}
|
264
|
-
}
|
265
|
-
|
266
|
-
var dopts = $.isFunction(opts.dlog_opts) ? opts.dlog_opts.call(self, opts) : opts.dlog_opts;
|
267
|
-
call(opts.dlog, selector, dopts);
|
268
|
-
var mopts = $.isFunction(opts.msel_opts) ? opts.msel_opts.call(self, opts) : opts.msel_opts;
|
269
|
-
call(opts.msel, select, mopts);
|
270
|
-
},
|
271
|
-
sortableRows : function (opts) {
|
272
|
-
// Can accept all sortable options and events
|
273
|
-
return this.each(function(){
|
274
|
-
var $t = this;
|
275
|
-
if(!$t.grid) { return; }
|
276
|
-
// Currently we disable a treeGrid sortable
|
277
|
-
if($t.p.treeGrid) { return; }
|
278
|
-
if($.fn.sortable) {
|
279
|
-
opts = $.extend({
|
280
|
-
"cursor":"move",
|
281
|
-
"axis" : "y",
|
282
|
-
"items": ".jqgrow"
|
283
|
-
},
|
284
|
-
opts || {});
|
285
|
-
if(opts.start && $.isFunction(opts.start)) {
|
286
|
-
opts._start_ = opts.start;
|
287
|
-
delete opts.start;
|
288
|
-
} else {opts._start_=false;}
|
289
|
-
if(opts.update && $.isFunction(opts.update)) {
|
290
|
-
opts._update_ = opts.update;
|
291
|
-
delete opts.update;
|
292
|
-
} else {opts._update_ = false;}
|
293
|
-
opts.start = function(ev,ui) {
|
294
|
-
$(ui.item).css("border-width","0px");
|
295
|
-
$("td",ui.item).each(function(i){
|
296
|
-
this.style.width = $t.grid.cols[i].style.width;
|
297
|
-
});
|
298
|
-
if($t.p.subGrid) {
|
299
|
-
var subgid = $(ui.item).attr("id");
|
300
|
-
try {
|
301
|
-
$($t).jqGrid('collapseSubGridRow',subgid);
|
302
|
-
} catch (e) {}
|
303
|
-
}
|
304
|
-
if(opts._start_) {
|
305
|
-
opts._start_.apply(this,[ev,ui]);
|
306
|
-
}
|
307
|
-
};
|
308
|
-
opts.update = function (ev,ui) {
|
309
|
-
$(ui.item).css("border-width","");
|
310
|
-
$t.
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
$("tbody:first",$t).
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
if(
|
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
|
-
ui.helper.
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
}
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
var tid = $(d).closest("table.ui-jqgrid-btable");
|
388
|
-
if($.data(tid[0],"dnd") !== undefined) {
|
389
|
-
var cn = $.data(tid[0],"dnd").connectWith;
|
390
|
-
return $.inArray('#'+this.id,cn) != -1 ? true : false;
|
391
|
-
}
|
392
|
-
return d;
|
393
|
-
},
|
394
|
-
drop: function(ev, ui) {
|
395
|
-
|
396
|
-
var
|
397
|
-
|
398
|
-
|
399
|
-
var
|
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
|
-
grid =
|
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
|
-
opts.connectWith
|
457
|
-
opts.connectWith =
|
458
|
-
$.
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
}
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
$($t).jqGrid('
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
}
|
503
|
-
})
|
1
|
+
;(function($){
|
2
|
+
/*
|
3
|
+
**
|
4
|
+
* jqGrid addons using jQuery UI
|
5
|
+
* Author: Mark Williams
|
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
|
+
* depends on jQuery UI
|
10
|
+
**/
|
11
|
+
if ($.browser.msie && $.browser.version==8) {
|
12
|
+
$.expr[":"].hidden = function(elem) {
|
13
|
+
return elem.offsetWidth === 0 || elem.offsetHeight === 0 ||
|
14
|
+
elem.style.display == "none";
|
15
|
+
};
|
16
|
+
}
|
17
|
+
// requiere load multiselect before grid
|
18
|
+
$.jgrid._multiselect = false;
|
19
|
+
if($.ui) {
|
20
|
+
if ($.ui.multiselect ) {
|
21
|
+
if($.ui.multiselect.prototype._setSelected) {
|
22
|
+
var setSelected = $.ui.multiselect.prototype._setSelected;
|
23
|
+
$.ui.multiselect.prototype._setSelected = function(item,selected) {
|
24
|
+
var ret = setSelected.call(this,item,selected);
|
25
|
+
if (selected && this.selectedList) {
|
26
|
+
var elt = this.element;
|
27
|
+
this.selectedList.find('li').each(function() {
|
28
|
+
if ($(this).data('optionLink')) {
|
29
|
+
$(this).data('optionLink').remove().appendTo(elt);
|
30
|
+
}
|
31
|
+
});
|
32
|
+
}
|
33
|
+
return ret;
|
34
|
+
};
|
35
|
+
}
|
36
|
+
if($.ui.multiselect.prototype.destroy) {
|
37
|
+
$.ui.multiselect.prototype.destroy = function() {
|
38
|
+
this.element.show();
|
39
|
+
this.container.remove();
|
40
|
+
if ($.Widget === undefined) {
|
41
|
+
$.widget.prototype.destroy.apply(this, arguments);
|
42
|
+
} else {
|
43
|
+
$.Widget.prototype.destroy.apply(this, arguments);
|
44
|
+
}
|
45
|
+
};
|
46
|
+
}
|
47
|
+
$.jgrid._multiselect = true;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
$.jgrid.extend({
|
52
|
+
sortableColumns : function (tblrow)
|
53
|
+
{
|
54
|
+
return this.each(function (){
|
55
|
+
var ts = this;
|
56
|
+
function start() {ts.p.disableClick = true;}
|
57
|
+
var sortable_opts = {
|
58
|
+
"tolerance" : "pointer",
|
59
|
+
"axis" : "x",
|
60
|
+
"scrollSensitivity": "1",
|
61
|
+
"items": '>th:not(:has(#jqgh_cb,#jqgh_rn,#jqgh_subgrid),:hidden)',
|
62
|
+
"placeholder": {
|
63
|
+
element: function(item) {
|
64
|
+
var el = $(document.createElement(item[0].nodeName))
|
65
|
+
.addClass(item[0].className+" ui-sortable-placeholder ui-state-highlight")
|
66
|
+
.removeClass("ui-sortable-helper")[0];
|
67
|
+
return el;
|
68
|
+
},
|
69
|
+
update: function(self, p) {
|
70
|
+
p.height(self.currentItem.innerHeight() - parseInt(self.currentItem.css('paddingTop')||0, 10) - parseInt(self.currentItem.css('paddingBottom')||0, 10));
|
71
|
+
p.width(self.currentItem.innerWidth() - parseInt(self.currentItem.css('paddingLeft')||0, 10) - parseInt(self.currentItem.css('paddingRight')||0, 10));
|
72
|
+
}
|
73
|
+
},
|
74
|
+
"update": function(event, ui) {
|
75
|
+
var p = $(ui.item).parent();
|
76
|
+
var th = $(">th", p);
|
77
|
+
var colModel = ts.p.colModel;
|
78
|
+
var cmMap = {};
|
79
|
+
$.each(colModel, function(i) { cmMap[this.name]=i; });
|
80
|
+
var permutation = [];
|
81
|
+
th.each(function(i) {
|
82
|
+
var id = $(">div", this).get(0).id.replace(/^jqgh_/, "");
|
83
|
+
if (id in cmMap) {
|
84
|
+
permutation.push(cmMap[id]);
|
85
|
+
}
|
86
|
+
});
|
87
|
+
|
88
|
+
$(ts).jqGrid("remapColumns",permutation, true, true);
|
89
|
+
if ($.isFunction(ts.p.sortable.update)) {
|
90
|
+
ts.p.sortable.update(permutation);
|
91
|
+
}
|
92
|
+
setTimeout(function(){ts.p.disableClick=false;}, 50);
|
93
|
+
}
|
94
|
+
};
|
95
|
+
if (ts.p.sortable.options) {
|
96
|
+
$.extend(sortable_opts, ts.p.sortable.options);
|
97
|
+
} else if ($.isFunction(ts.p.sortable)) {
|
98
|
+
ts.p.sortable = { "update" : ts.p.sortable };
|
99
|
+
}
|
100
|
+
if (sortable_opts.start) {
|
101
|
+
var s = sortable_opts.start;
|
102
|
+
sortable_opts.start = function(e,ui) {
|
103
|
+
start();
|
104
|
+
s.call(this,e,ui);
|
105
|
+
};
|
106
|
+
} else {
|
107
|
+
sortable_opts.start = start;
|
108
|
+
}
|
109
|
+
if (ts.p.sortable.exclude) {
|
110
|
+
sortable_opts.items += ":not("+ts.p.sortable.exclude+")";
|
111
|
+
}
|
112
|
+
tblrow.sortable(sortable_opts).data("sortable").floating = true;
|
113
|
+
});
|
114
|
+
},
|
115
|
+
columnChooser : function(opts) {
|
116
|
+
var self = this;
|
117
|
+
if($("#colchooser_"+self[0].p.id).length ) { return; }
|
118
|
+
var selector = $('<div id="colchooser_'+self[0].p.id+'" style="position:relative;overflow:hidden"><div><select multiple="multiple"></select></div></div>');
|
119
|
+
var select = $('select', selector);
|
120
|
+
|
121
|
+
function insert(perm,i,v) {
|
122
|
+
if(i>=0){
|
123
|
+
var a = perm.slice();
|
124
|
+
var b = a.splice(i,Math.max(perm.length-i,i));
|
125
|
+
if(i>perm.length) { i = perm.length; }
|
126
|
+
a[i] = v;
|
127
|
+
return a.concat(b);
|
128
|
+
}
|
129
|
+
}
|
130
|
+
opts = $.extend({
|
131
|
+
"width" : 420,
|
132
|
+
"height" : 240,
|
133
|
+
"classname" : null,
|
134
|
+
"done" : function(perm) { if (perm) { self.jqGrid("remapColumns", perm, true); } },
|
135
|
+
/* msel is either the name of a ui widget class that
|
136
|
+
extends a multiselect, or a function that supports
|
137
|
+
creating a multiselect object (with no argument,
|
138
|
+
or when passed an object), and destroying it (when
|
139
|
+
passed the string "destroy"). */
|
140
|
+
"msel" : "multiselect",
|
141
|
+
/* "msel_opts" : {}, */
|
142
|
+
|
143
|
+
/* dlog is either the name of a ui widget class that
|
144
|
+
behaves in a dialog-like way, or a function, that
|
145
|
+
supports creating a dialog (when passed dlog_opts)
|
146
|
+
or destroying a dialog (when passed the string
|
147
|
+
"destroy")
|
148
|
+
*/
|
149
|
+
"dlog" : "dialog",
|
150
|
+
|
151
|
+
/* dlog_opts is either an option object to be passed
|
152
|
+
to "dlog", or (more likely) a function that creates
|
153
|
+
the options object.
|
154
|
+
The default produces a suitable options object for
|
155
|
+
ui.dialog */
|
156
|
+
"dlog_opts" : function(opts) {
|
157
|
+
var buttons = {};
|
158
|
+
buttons[opts.bSubmit] = function() {
|
159
|
+
opts.apply_perm();
|
160
|
+
opts.cleanup(false);
|
161
|
+
};
|
162
|
+
buttons[opts.bCancel] = function() {
|
163
|
+
opts.cleanup(true);
|
164
|
+
};
|
165
|
+
return {
|
166
|
+
"buttons": buttons,
|
167
|
+
"close": function() {
|
168
|
+
opts.cleanup(true);
|
169
|
+
},
|
170
|
+
"modal" : false,
|
171
|
+
"resizable": false,
|
172
|
+
"width": opts.width+20
|
173
|
+
};
|
174
|
+
},
|
175
|
+
/* Function to get the permutation array, and pass it to the
|
176
|
+
"done" function */
|
177
|
+
"apply_perm" : function() {
|
178
|
+
$('option',select).each(function(i) {
|
179
|
+
if (this.selected) {
|
180
|
+
self.jqGrid("showCol", colModel[this.value].name);
|
181
|
+
} else {
|
182
|
+
self.jqGrid("hideCol", colModel[this.value].name);
|
183
|
+
}
|
184
|
+
});
|
185
|
+
|
186
|
+
var perm = [];
|
187
|
+
//fixedCols.slice(0);
|
188
|
+
$('option[selected]',select).each(function() { perm.push(parseInt(this.value,10)); });
|
189
|
+
$.each(perm, function() { delete colMap[colModel[parseInt(this,10)].name]; });
|
190
|
+
$.each(colMap, function() {
|
191
|
+
var ti = parseInt(this,10);
|
192
|
+
perm = insert(perm,ti,ti);
|
193
|
+
});
|
194
|
+
if (opts.done) {
|
195
|
+
opts.done.call(self, perm);
|
196
|
+
}
|
197
|
+
},
|
198
|
+
/* Function to cleanup the dialog, and select. Also calls the
|
199
|
+
done function with no permutation (to indicate that the
|
200
|
+
columnChooser was aborted */
|
201
|
+
"cleanup" : function(calldone) {
|
202
|
+
call(opts.dlog, selector, 'destroy');
|
203
|
+
call(opts.msel, select, 'destroy');
|
204
|
+
selector.remove();
|
205
|
+
if (calldone && opts.done) {
|
206
|
+
opts.done.call(self);
|
207
|
+
}
|
208
|
+
},
|
209
|
+
"msel_opts" : {}
|
210
|
+
}, $.jgrid.col, opts || {});
|
211
|
+
if($.ui) {
|
212
|
+
if ($.ui.multiselect ) {
|
213
|
+
if(opts.msel == "multiselect") {
|
214
|
+
if(!$.jgrid._multiselect) {
|
215
|
+
// should be in language file
|
216
|
+
alert("Multiselect plugin loaded after jqGrid. Please load the plugin before the jqGrid!");
|
217
|
+
return;
|
218
|
+
}
|
219
|
+
opts.msel_opts = $.extend($.ui.multiselect.defaults,opts.msel_opts);
|
220
|
+
}
|
221
|
+
}
|
222
|
+
}
|
223
|
+
if (opts.caption) {
|
224
|
+
selector.attr("title", opts.caption);
|
225
|
+
}
|
226
|
+
if (opts.classname) {
|
227
|
+
selector.addClass(opts.classname);
|
228
|
+
select.addClass(opts.classname);
|
229
|
+
}
|
230
|
+
if (opts.width) {
|
231
|
+
$(">div",selector).css({"width": opts.width,"margin":"0 auto"});
|
232
|
+
select.css("width", opts.width);
|
233
|
+
}
|
234
|
+
if (opts.height) {
|
235
|
+
$(">div",selector).css("height", opts.height);
|
236
|
+
select.css("height", opts.height - 10);
|
237
|
+
}
|
238
|
+
var colModel = self.jqGrid("getGridParam", "colModel");
|
239
|
+
var colNames = self.jqGrid("getGridParam", "colNames");
|
240
|
+
var colMap = {}, fixedCols = [];
|
241
|
+
|
242
|
+
select.empty();
|
243
|
+
$.each(colModel, function(i) {
|
244
|
+
colMap[this.name] = i;
|
245
|
+
if (this.hidedlg) {
|
246
|
+
if (!this.hidden) {
|
247
|
+
fixedCols.push(i);
|
248
|
+
}
|
249
|
+
return;
|
250
|
+
}
|
251
|
+
|
252
|
+
select.append("<option value='"+i+"' "+
|
253
|
+
(this.hidden?"":"selected='selected'")+">"+colNames[i]+"</option>");
|
254
|
+
});
|
255
|
+
function call(fn, obj) {
|
256
|
+
if (!fn) { return; }
|
257
|
+
if (typeof fn == 'string') {
|
258
|
+
if ($.fn[fn]) {
|
259
|
+
$.fn[fn].apply(obj, $.makeArray(arguments).slice(2));
|
260
|
+
}
|
261
|
+
} else if ($.isFunction(fn)) {
|
262
|
+
fn.apply(obj, $.makeArray(arguments).slice(2));
|
263
|
+
}
|
264
|
+
}
|
265
|
+
|
266
|
+
var dopts = $.isFunction(opts.dlog_opts) ? opts.dlog_opts.call(self, opts) : opts.dlog_opts;
|
267
|
+
call(opts.dlog, selector, dopts);
|
268
|
+
var mopts = $.isFunction(opts.msel_opts) ? opts.msel_opts.call(self, opts) : opts.msel_opts;
|
269
|
+
call(opts.msel, select, mopts);
|
270
|
+
},
|
271
|
+
sortableRows : function (opts) {
|
272
|
+
// Can accept all sortable options and events
|
273
|
+
return this.each(function(){
|
274
|
+
var $t = this;
|
275
|
+
if(!$t.grid) { return; }
|
276
|
+
// Currently we disable a treeGrid sortable
|
277
|
+
if($t.p.treeGrid) { return; }
|
278
|
+
if($.fn.sortable) {
|
279
|
+
opts = $.extend({
|
280
|
+
"cursor":"move",
|
281
|
+
"axis" : "y",
|
282
|
+
"items": ".jqgrow"
|
283
|
+
},
|
284
|
+
opts || {});
|
285
|
+
if(opts.start && $.isFunction(opts.start)) {
|
286
|
+
opts._start_ = opts.start;
|
287
|
+
delete opts.start;
|
288
|
+
} else {opts._start_=false;}
|
289
|
+
if(opts.update && $.isFunction(opts.update)) {
|
290
|
+
opts._update_ = opts.update;
|
291
|
+
delete opts.update;
|
292
|
+
} else {opts._update_ = false;}
|
293
|
+
opts.start = function(ev,ui) {
|
294
|
+
$(ui.item).css("border-width","0px");
|
295
|
+
$("td",ui.item).each(function(i){
|
296
|
+
this.style.width = $t.grid.cols[i].style.width;
|
297
|
+
});
|
298
|
+
if($t.p.subGrid) {
|
299
|
+
var subgid = $(ui.item).attr("id");
|
300
|
+
try {
|
301
|
+
$($t).jqGrid('collapseSubGridRow',subgid);
|
302
|
+
} catch (e) {}
|
303
|
+
}
|
304
|
+
if(opts._start_) {
|
305
|
+
opts._start_.apply(this,[ev,ui]);
|
306
|
+
}
|
307
|
+
};
|
308
|
+
opts.update = function (ev,ui) {
|
309
|
+
$(ui.item).css("border-width","");
|
310
|
+
if($t.p.rownumbers === true) {
|
311
|
+
$("td.jqgrid-rownum",$t.rows).each(function(i){
|
312
|
+
$(this).html(i+1);
|
313
|
+
});
|
314
|
+
}
|
315
|
+
if(opts._update_) {
|
316
|
+
opts._update_.apply(this,[ev,ui]);
|
317
|
+
}
|
318
|
+
};
|
319
|
+
$("tbody:first",$t).sortable(opts);
|
320
|
+
$("tbody:first",$t).disableSelection();
|
321
|
+
}
|
322
|
+
});
|
323
|
+
},
|
324
|
+
gridDnD : function(opts) {
|
325
|
+
return this.each(function(){
|
326
|
+
var $t = this;
|
327
|
+
if(!$t.grid) { return; }
|
328
|
+
// Currently we disable a treeGrid drag and drop
|
329
|
+
if($t.p.treeGrid) { return; }
|
330
|
+
if(!$.fn.draggable || !$.fn.droppable) { return; }
|
331
|
+
function updateDnD ()
|
332
|
+
{
|
333
|
+
var datadnd = $.data($t,"dnd");
|
334
|
+
$("tr.jqgrow:not(.ui-draggable)",$t).draggable($.isFunction(datadnd.drag) ? datadnd.drag.call($($t),datadnd) : datadnd.drag);
|
335
|
+
}
|
336
|
+
var appender = "<table id='jqgrid_dnd' class='ui-jqgrid-dnd'></table>";
|
337
|
+
if($("#jqgrid_dnd").html() === null) {
|
338
|
+
$('body').append(appender);
|
339
|
+
}
|
340
|
+
|
341
|
+
if(typeof opts == 'string' && opts == 'updateDnD' && $t.p.jqgdnd===true) {
|
342
|
+
updateDnD();
|
343
|
+
return;
|
344
|
+
}
|
345
|
+
opts = $.extend({
|
346
|
+
"drag" : function (opts) {
|
347
|
+
return $.extend({
|
348
|
+
start : function (ev, ui) {
|
349
|
+
// if we are in subgrid mode try to collapse the node
|
350
|
+
if($t.p.subGrid) {
|
351
|
+
var subgid = $(ui.helper).attr("id");
|
352
|
+
try {
|
353
|
+
$($t).jqGrid('collapseSubGridRow',subgid);
|
354
|
+
} catch (e) {}
|
355
|
+
}
|
356
|
+
// hack
|
357
|
+
// drag and drop does not insert tr in table, when the table has no rows
|
358
|
+
// we try to insert new empty row on the target(s)
|
359
|
+
for (var i=0;i<$.data($t,"dnd").connectWith.length;i++){
|
360
|
+
if($($.data($t,"dnd").connectWith[i]).jqGrid('getGridParam','reccount') == "0" ){
|
361
|
+
$($.data($t,"dnd").connectWith[i]).jqGrid('addRowData','jqg_empty_row',{});
|
362
|
+
}
|
363
|
+
}
|
364
|
+
ui.helper.addClass("ui-state-highlight");
|
365
|
+
$("td",ui.helper).each(function(i) {
|
366
|
+
this.style.width = $t.grid.headers[i].width+"px";
|
367
|
+
});
|
368
|
+
if(opts.onstart && $.isFunction(opts.onstart) ) { opts.onstart.call($($t),ev,ui); }
|
369
|
+
},
|
370
|
+
stop :function(ev,ui) {
|
371
|
+
if(ui.helper.dropped) {
|
372
|
+
var ids = $(ui.helper).attr("id");
|
373
|
+
$($t).jqGrid('delRowData',ids );
|
374
|
+
}
|
375
|
+
// if we have a empty row inserted from start event try to delete it
|
376
|
+
for (var i=0;i<$.data($t,"dnd").connectWith.length;i++){
|
377
|
+
$($.data($t,"dnd").connectWith[i]).jqGrid('delRowData','jqg_empty_row');
|
378
|
+
}
|
379
|
+
if(opts.onstop && $.isFunction(opts.onstop) ) { opts.onstop.call($($t),ev,ui); }
|
380
|
+
}
|
381
|
+
},opts.drag_opts || {});
|
382
|
+
},
|
383
|
+
"drop" : function (opts) {
|
384
|
+
return $.extend({
|
385
|
+
accept: function(d) {
|
386
|
+
if (!$(d).hasClass('jqgrow')) { return d;}
|
387
|
+
var tid = $(d).closest("table.ui-jqgrid-btable");
|
388
|
+
if(tid.length > 0 && $.data(tid[0],"dnd") !== undefined) {
|
389
|
+
var cn = $.data(tid[0],"dnd").connectWith;
|
390
|
+
return $.inArray('#'+this.id,cn) != -1 ? true : false;
|
391
|
+
}
|
392
|
+
return d;
|
393
|
+
},
|
394
|
+
drop: function(ev, ui) {
|
395
|
+
if (!$(ui.draggable).hasClass('jqgrow')) { return; }
|
396
|
+
var accept = $(ui.draggable).attr("id");
|
397
|
+
var getdata = ui.draggable.parent().parent().jqGrid('getRowData',accept);
|
398
|
+
if(!opts.dropbyname) {
|
399
|
+
var j =0, tmpdata = {}, dropname;
|
400
|
+
var dropmodel = $("#"+this.id).jqGrid('getGridParam','colModel');
|
401
|
+
try {
|
402
|
+
for (var key in getdata) {
|
403
|
+
if(getdata.hasOwnProperty(key) && dropmodel[j]) {
|
404
|
+
dropname = dropmodel[j].name;
|
405
|
+
tmpdata[dropname] = getdata[key];
|
406
|
+
}
|
407
|
+
j++;
|
408
|
+
}
|
409
|
+
getdata = tmpdata;
|
410
|
+
} catch (e) {}
|
411
|
+
}
|
412
|
+
ui.helper.dropped = true;
|
413
|
+
if(opts.beforedrop && $.isFunction(opts.beforedrop) ) {
|
414
|
+
//parameters to this callback - event, element, data to be inserted, sender, reciever
|
415
|
+
// should return object which will be inserted into the reciever
|
416
|
+
var datatoinsert = opts.beforedrop.call(this,ev,ui,getdata,$('#'+$t.id),$(this));
|
417
|
+
if (typeof datatoinsert != "undefined" && datatoinsert !== null && typeof datatoinsert == "object") { getdata = datatoinsert; }
|
418
|
+
}
|
419
|
+
if(ui.helper.dropped) {
|
420
|
+
var grid;
|
421
|
+
if(opts.autoid) {
|
422
|
+
if($.isFunction(opts.autoid)) {
|
423
|
+
grid = opts.autoid.call(this,getdata);
|
424
|
+
} else {
|
425
|
+
grid = Math.ceil(Math.random()*1000);
|
426
|
+
grid = opts.autoidprefix+grid;
|
427
|
+
}
|
428
|
+
}
|
429
|
+
// NULL is interpreted as undefined while null as object
|
430
|
+
$("#"+this.id).jqGrid('addRowData',grid,getdata,opts.droppos);
|
431
|
+
}
|
432
|
+
if(opts.ondrop && $.isFunction(opts.ondrop) ) { opts.ondrop.call(this,ev,ui, getdata); }
|
433
|
+
}}, opts.drop_opts || {});
|
434
|
+
},
|
435
|
+
"onstart" : null,
|
436
|
+
"onstop" : null,
|
437
|
+
"beforedrop": null,
|
438
|
+
"ondrop" : null,
|
439
|
+
"drop_opts" : {
|
440
|
+
"activeClass": "ui-state-active",
|
441
|
+
"hoverClass": "ui-state-hover"
|
442
|
+
},
|
443
|
+
"drag_opts" : {
|
444
|
+
"revert": "invalid",
|
445
|
+
"helper": "clone",
|
446
|
+
"cursor": "move",
|
447
|
+
"appendTo" : "#jqgrid_dnd",
|
448
|
+
"zIndex": 5000
|
449
|
+
},
|
450
|
+
"dropbyname" : false,
|
451
|
+
"droppos" : "first",
|
452
|
+
"autoid" : true,
|
453
|
+
"autoidprefix" : "dnd_"
|
454
|
+
}, opts || {});
|
455
|
+
|
456
|
+
if(!opts.connectWith) { return; }
|
457
|
+
opts.connectWith = opts.connectWith.split(",");
|
458
|
+
opts.connectWith = $.map(opts.connectWith,function(n){return $.trim(n);});
|
459
|
+
$.data($t,"dnd",opts);
|
460
|
+
|
461
|
+
if($t.p.reccount != "0" && !$t.p.jqgdnd) {
|
462
|
+
updateDnD();
|
463
|
+
}
|
464
|
+
$t.p.jqgdnd = true;
|
465
|
+
for (var i=0;i<opts.connectWith.length;i++){
|
466
|
+
var cn =opts.connectWith[i];
|
467
|
+
$(cn).droppable($.isFunction(opts.drop) ? opts.drop.call($($t),opts) : opts.drop);
|
468
|
+
}
|
469
|
+
});
|
470
|
+
},
|
471
|
+
gridResize : function(opts) {
|
472
|
+
return this.each(function(){
|
473
|
+
var $t = this;
|
474
|
+
if(!$t.grid || !$.fn.resizable) { return; }
|
475
|
+
opts = $.extend({}, opts || {});
|
476
|
+
if(opts.alsoResize ) {
|
477
|
+
opts._alsoResize_ = opts.alsoResize;
|
478
|
+
delete opts.alsoResize;
|
479
|
+
} else {
|
480
|
+
opts._alsoResize_ = false;
|
481
|
+
}
|
482
|
+
if(opts.stop && $.isFunction(opts.stop)) {
|
483
|
+
opts._stop_ = opts.stop;
|
484
|
+
delete opts.stop;
|
485
|
+
} else {
|
486
|
+
opts._stop_ = false;
|
487
|
+
}
|
488
|
+
opts.stop = function (ev, ui) {
|
489
|
+
$($t).jqGrid('setGridParam',{height:$("#gview_"+$t.p.id+" .ui-jqgrid-bdiv").height()});
|
490
|
+
$($t).jqGrid('setGridWidth',ui.size.width,opts.shrinkToFit);
|
491
|
+
if(opts._stop_) { opts._stop_.call($t,ev,ui); }
|
492
|
+
};
|
493
|
+
if(opts._alsoResize_) {
|
494
|
+
var optstest = "{\'#gview_"+$t.p.id+" .ui-jqgrid-bdiv\':true,'" +opts._alsoResize_+"':true}";
|
495
|
+
opts.alsoResize = eval('('+optstest+')'); // the only way that I found to do this
|
496
|
+
} else {
|
497
|
+
opts.alsoResize = $(".ui-jqgrid-bdiv","#gview_"+$t.p.id);
|
498
|
+
}
|
499
|
+
delete opts._alsoResize_;
|
500
|
+
$("#gbox_"+$t.p.id).resizable(opts);
|
501
|
+
});
|
502
|
+
}
|
503
|
+
});
|
504
|
+
})(jQuery);
|