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.
Files changed (95) hide show
  1. data/VERSION +1 -1
  2. data/public/javascripts/rails-jqgrid/Changes.txt +0 -0
  3. data/public/javascripts/rails-jqgrid/i18n/grid.locale-bg.js +132 -1
  4. data/public/javascripts/rails-jqgrid/i18n/grid.locale-bg1251.js +132 -1
  5. data/public/javascripts/rails-jqgrid/i18n/grid.locale-cat.js +128 -1
  6. data/public/javascripts/rails-jqgrid/i18n/grid.locale-cn.js +132 -1
  7. data/public/javascripts/rails-jqgrid/i18n/grid.locale-cs.js +128 -1
  8. data/public/javascripts/rails-jqgrid/i18n/grid.locale-da.js +128 -0
  9. data/public/javascripts/rails-jqgrid/i18n/grid.locale-de.js +133 -1
  10. data/public/javascripts/rails-jqgrid/i18n/grid.locale-el.js +126 -1
  11. data/public/javascripts/rails-jqgrid/i18n/grid.locale-en.js +128 -1
  12. data/public/javascripts/rails-jqgrid/i18n/grid.locale-es.js +128 -1
  13. data/public/javascripts/rails-jqgrid/i18n/grid.locale-fa.js +145 -1
  14. data/public/javascripts/rails-jqgrid/i18n/grid.locale-fi.js +130 -1
  15. data/public/javascripts/rails-jqgrid/i18n/grid.locale-fr.js +126 -1
  16. data/public/javascripts/rails-jqgrid/i18n/grid.locale-gl.js +126 -0
  17. data/public/javascripts/rails-jqgrid/i18n/grid.locale-he.js +127 -1
  18. data/public/javascripts/rails-jqgrid/i18n/grid.locale-hu.js +129 -1
  19. data/public/javascripts/rails-jqgrid/i18n/grid.locale-is.js +126 -1
  20. data/public/javascripts/rails-jqgrid/i18n/grid.locale-it.js +1 -1
  21. data/public/javascripts/rails-jqgrid/i18n/grid.locale-ja.js +155 -1
  22. data/public/javascripts/rails-jqgrid/i18n/grid.locale-nl.js +149 -1
  23. data/public/javascripts/rails-jqgrid/i18n/grid.locale-no.js +1 -1
  24. data/public/javascripts/rails-jqgrid/i18n/grid.locale-pl.js +127 -1
  25. data/public/javascripts/rails-jqgrid/i18n/grid.locale-pt-br.js +127 -1
  26. data/public/javascripts/rails-jqgrid/i18n/grid.locale-pt.js +125 -1
  27. data/public/javascripts/rails-jqgrid/i18n/grid.locale-ro.js +139 -1
  28. data/public/javascripts/rails-jqgrid/i18n/grid.locale-ru.js +127 -1
  29. data/public/javascripts/rails-jqgrid/i18n/grid.locale-sk.js +127 -1
  30. data/public/javascripts/rails-jqgrid/i18n/grid.locale-sr.js +128 -0
  31. data/public/javascripts/rails-jqgrid/i18n/grid.locale-sv.js +127 -1
  32. data/public/javascripts/rails-jqgrid/i18n/grid.locale-tr.js +126 -1
  33. data/public/javascripts/rails-jqgrid/i18n/grid.locale-ua.js +127 -1
  34. data/public/javascripts/rails-jqgrid/install.txt +0 -0
  35. data/public/javascripts/rails-jqgrid/jquery.jqGrid.min.js +445 -432
  36. data/public/javascripts/rails-jqgrid/src/JsonXml.js +329 -329
  37. data/public/javascripts/rails-jqgrid/src/css/ellipsis-xbl.xml +0 -0
  38. data/public/javascripts/rails-jqgrid/src/css/ui.jqgrid.css +139 -129
  39. data/public/javascripts/rails-jqgrid/src/css/ui.multiselect.css +0 -0
  40. data/public/javascripts/rails-jqgrid/src/grid.base.js +3078 -3003
  41. data/public/javascripts/rails-jqgrid/src/grid.celledit.js +486 -486
  42. data/public/javascripts/rails-jqgrid/src/grid.common.js +646 -636
  43. data/public/javascripts/rails-jqgrid/src/grid.custom.js +820 -817
  44. data/public/javascripts/rails-jqgrid/src/grid.formedit.js +1954 -1872
  45. data/public/javascripts/rails-jqgrid/src/grid.grouping.js +250 -0
  46. data/public/javascripts/rails-jqgrid/src/grid.import.js +200 -200
  47. data/public/javascripts/rails-jqgrid/src/grid.inlinedit.js +255 -250
  48. data/public/javascripts/rails-jqgrid/src/grid.jqueryui.js +504 -503
  49. data/public/javascripts/rails-jqgrid/src/grid.loader.js +1 -0
  50. data/public/javascripts/rails-jqgrid/src/grid.postext.js +63 -63
  51. data/public/javascripts/rails-jqgrid/src/grid.setcolumns.js +125 -125
  52. data/public/javascripts/rails-jqgrid/src/grid.subgrid.js +260 -260
  53. data/public/javascripts/rails-jqgrid/src/grid.tbltogrid.js +106 -106
  54. data/public/javascripts/rails-jqgrid/src/grid.treegrid.js +489 -482
  55. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-bg.js +132 -132
  56. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-bg1251.js +132 -132
  57. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-cat.js +128 -128
  58. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-cn.js +132 -132
  59. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-cs.js +128 -128
  60. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-da.js +128 -0
  61. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-de.js +132 -127
  62. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-dk.js +0 -0
  63. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-el.js +126 -126
  64. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-en.js +128 -128
  65. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-es.js +128 -128
  66. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-fa.js +145 -125
  67. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-fi.js +130 -130
  68. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-fr.js +2 -2
  69. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-gl.js +126 -0
  70. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-he.js +127 -127
  71. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-hu.js +129 -129
  72. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-is.js +126 -126
  73. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-it.js +0 -0
  74. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-ja.js +155 -155
  75. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-nl.js +148 -148
  76. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-no.js +0 -0
  77. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-pl.js +126 -126
  78. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-pt-br.js +127 -127
  79. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-pt.js +125 -125
  80. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-ro.js +139 -139
  81. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-ru.js +127 -127
  82. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-sk.js +127 -127
  83. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-sr.js +128 -0
  84. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-sv.js +127 -127
  85. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-tr.js +126 -126
  86. data/public/javascripts/rails-jqgrid/src/i18n/grid.locale-ua.js +127 -127
  87. data/public/javascripts/rails-jqgrid/src/jqDnR.js +68 -67
  88. data/public/javascripts/rails-jqgrid/src/jqModal.js +68 -68
  89. data/public/javascripts/rails-jqgrid/src/jquery.fmatter.js +563 -541
  90. data/public/javascripts/rails-jqgrid/src/jquery.searchFilter.js +1 -1
  91. data/public/javascripts/rails-jqgrid/src/ui.multiselect.js +0 -0
  92. data/public/stylesheets/rails-jqgrid/ellipsis-xbl.xml +0 -0
  93. data/public/stylesheets/rails-jqgrid/ui.jqgrid.css +139 -2
  94. data/rails_jq_grid.gemspec +10 -3
  95. 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
- opts = $.extend({
122
- "width" : 420,
123
- "height" : 240,
124
- "classname" : null,
125
- "done" : function(perm) { if (perm) { self.jqGrid("remapColumns", perm, true); } },
126
- /* msel is either the name of a ui widget class that
127
- extends a multiselect, or a function that supports
128
- creating a multiselect object (with no argument,
129
- or when passed an object), and destroying it (when
130
- passed the string "destroy"). */
131
- "msel" : "multiselect",
132
- /* "msel_opts" : {}, */
133
-
134
- /* dlog is either the name of a ui widget class that
135
- behaves in a dialog-like way, or a function, that
136
- supports creating a dialog (when passed dlog_opts)
137
- or destroying a dialog (when passed the string
138
- "destroy")
139
- */
140
- "dlog" : "dialog",
141
-
142
- /* dlog_opts is either an option object to be passed
143
- to "dlog", or (more likely) a function that creates
144
- the options object.
145
- The default produces a suitable options object for
146
- ui.dialog */
147
- "dlog_opts" : function(opts) {
148
- var buttons = {};
149
- buttons[opts.bSubmit] = function() {
150
- opts.apply_perm();
151
- opts.cleanup(false);
152
- };
153
- buttons[opts.bCancel] = function() {
154
- opts.cleanup(true);
155
- };
156
- return {
157
- "buttons": buttons,
158
- "close": function() {
159
- opts.cleanup(true);
160
- },
161
- "modal" : false,
162
- "resizable": false,
163
- "width": opts.width+20
164
- };
165
- },
166
- /* Function to get the permutation array, and pass it to the
167
- "done" function */
168
- "apply_perm" : function() {
169
- $('option',select).each(function(i) {
170
- if (this.selected) {
171
- self.jqGrid("showCol", colModel[this.value].name);
172
- } else {
173
- self.jqGrid("hideCol", colModel[this.value].name);
174
- }
175
- });
176
-
177
- var perm = [];
178
- //fixedCols.slice(0);
179
- $('option[selected]',select).each(function() { perm.push(parseInt(this.value,10)); });
180
- $.each(perm, function() { delete colMap[colModel[parseInt(this,10)].name]; });
181
- $.each(colMap, function() {
182
- var ti = parseInt(this,10);
183
- perm = insert(perm,ti,ti);
184
- });
185
- if (opts.done) {
186
- opts.done.call(self, perm);
187
- }
188
- },
189
- /* Function to cleanup the dialog, and select. Also calls the
190
- done function with no permutation (to indicate that the
191
- columnChooser was aborted */
192
- "cleanup" : function(calldone) {
193
- call(opts.dlog, selector, 'destroy');
194
- call(opts.msel, select, 'destroy');
195
- selector.remove();
196
- if (calldone && opts.done) {
197
- opts.done.call(self);
198
- }
199
- },
200
- "msel_opts" : {}
201
- }, $.jgrid.col, opts || {});
202
- if($.ui) {
203
- if ($.ui.multiselect ) {
204
- if(opts.msel == "multiselect") {
205
- if(!$.jgrid._multiselect) {
206
- // should be in language file
207
- alert("Multiselect plugin loaded after jqGrid. Please load the plugin before the jqGrid!");
208
- return;
209
- }
210
- opts.msel_opts = $.extend($.ui.multiselect.defaults,opts.msel_opts);
211
- }
212
- }
213
- }
214
- if (opts.caption) {
215
- selector.attr("title", opts.caption);
216
- }
217
- if (opts.classname) {
218
- selector.addClass(opts.classname);
219
- select.addClass(opts.classname);
220
- }
221
- if (opts.width) {
222
- $(">div",selector).css({"width": opts.width,"margin":"0 auto"});
223
- select.css("width", opts.width);
224
- }
225
- if (opts.height) {
226
- $(">div",selector).css("height", opts.height);
227
- select.css("height", opts.height - 10);
228
- }
229
- var colModel = self.jqGrid("getGridParam", "colModel");
230
- var colNames = self.jqGrid("getGridParam", "colNames");
231
- var colMap = {}, fixedCols = [];
232
-
233
- select.empty();
234
- $.each(colModel, function(i) {
235
- colMap[this.name] = i;
236
- if (this.hidedlg) {
237
- if (!this.hidden) {
238
- fixedCols.push(i);
239
- }
240
- return;
241
- }
242
-
243
- select.append("<option value='"+i+"' "+
244
- (this.hidden?"":"selected='selected'")+">"+colNames[i]+"</option>");
245
- });
246
- function insert(perm,i,v) {
247
- if(i>=0){
248
- var a = perm.slice();
249
- var b = a.splice(i,Math.max(perm.length-i,i));
250
- if(i>perm.length) { i = perm.length; }
251
- a[i] = v;
252
- return a.concat(b);
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.updateColumns();
311
- if($t.p.rownumbers === true) {
312
- $("td.jqgrid-rownum",$t.rows).each(function(i){
313
- $(this).html(i+1);
314
- });
315
- }
316
- if(opts._update_) {
317
- opts._update_.apply(this,[ev,ui]);
318
- }
319
- };
320
- $("tbody:first",$t).sortable(opts);
321
- $("tbody:first",$t).disableSelection();
322
- }
323
- });
324
- },
325
- gridDnD : function(opts) {
326
- return this.each(function(){
327
- var $t = this;
328
- if(!$t.grid) { return; }
329
- // Currently we disable a treeGrid drag and drop
330
- if($t.p.treeGrid) { return; }
331
- if(!$.fn.draggable || !$.fn.droppable) { return; }
332
- function updateDnD ()
333
- {
334
- var datadnd = $.data($t,"dnd");
335
- $("tr.jqgrow:not(.ui-draggable)",$t).draggable($.isFunction(datadnd.drag) ? datadnd.drag.call($($t),datadnd) : datadnd.drag);
336
- }
337
- var appender = "<table id='jqgrid_dnd' class='ui-jqgrid-dnd'></table>";
338
- if($("#jqgrid_dnd").html() === null) {
339
- $('body').append(appender);
340
- }
341
-
342
- if(typeof opts == 'string' && opts == 'updateDnD' && $t.p.jqgdnd===true) {
343
- updateDnD();
344
- return;
345
- }
346
- opts = $.extend({
347
- "drag" : function (opts) {
348
- return $.extend({
349
- start : function (ev, ui) {
350
- // if we are in subgrid mode try to collapse the node
351
- if($t.p.subGrid) {
352
- var subgid = $(ui.helper).attr("id");
353
- try {
354
- $($t).jqGrid('collapseSubGridRow',subgid);
355
- } catch (e) {}
356
- }
357
- // hack
358
- // drag and drop does not insert tr in table, when the table has no rows
359
- // we try to insert new empty row on the target(s)
360
- for (var i=0;i<$.data($t,"dnd").connectWith.length;i++){
361
- if($($.data($t,"dnd").connectWith[i]).jqGrid('getGridParam','reccount') == "0" ){
362
- $($.data($t,"dnd").connectWith[i]).jqGrid('addRowData','jqg_empty_row',{});
363
- }
364
- }
365
- ui.helper.addClass("ui-state-highlight");
366
- $("td",ui.helper).each(function(i) {
367
- this.style.width = $t.grid.headers[i].width+"px";
368
- });
369
- if(opts.onstart && $.isFunction(opts.onstart) ) { opts.onstart.call($($t),ev,ui); }
370
- },
371
- stop :function(ev,ui) {
372
- if(ui.helper.dropped) {
373
- var ids = $(ui.helper).attr("id");
374
- $($t).jqGrid('delRowData',ids );
375
- }
376
- // if we have a empty row inserted from start event try to delete it
377
- for (var i=0;i<$.data($t,"dnd").connectWith.length;i++){
378
- $($.data($t,"dnd").connectWith[i]).jqGrid('delRowData','jqg_empty_row');
379
- }
380
- if(opts.onstop && $.isFunction(opts.onstop) ) { opts.onstop.call($($t),ev,ui); }
381
- }
382
- },opts.drag_opts || {});
383
- },
384
- "drop" : function (opts) {
385
- return $.extend({
386
- accept: function(d) {
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
- var accept = $(ui.draggable).attr("id");
396
- var getdata = $('#'+$t.id).jqGrid('getRowData',accept);
397
- if(!opts.dropbyname) {
398
- var j =0, tmpdata = {}, dropname;
399
- var dropmodel = $("#"+this.id).jqGrid('getGridParam','colModel');
400
- try {
401
- for (var key in getdata) {
402
- if(getdata.hasOwnProperty(key) && dropmodel[j]) {
403
- dropname = dropmodel[j].name;
404
- tmpdata[dropname] = getdata[key];
405
- }
406
- j++;
407
- }
408
- getdata = tmpdata;
409
- } catch (e) {}
410
- }
411
- ui.helper.dropped = true;
412
- if(opts.beforedrop && $.isFunction(opts.beforedrop) ) {
413
- //parameters to this callback - event, element, data to be inserted, sender, reciever
414
- // should return object which will be inserted into the reciever
415
- var datatoinsert = opts.beforedrop.call(this,ev,ui,getdata,$('#'+$t.id),$(this));
416
- if (typeof datatoinsert != "undefined" && datatoinsert !== null && typeof datatoinsert == "object") { getdata = datatoinsert; }
417
- }
418
- if(ui.helper.dropped) {
419
- var grid;
420
- if(opts.autoid) {
421
- if($.isFunction(opts.autoid)) {
422
- grid = opts.autoid.call(this,getdata);
423
- } else {
424
- grid = Math.ceil(Math.random()*1000);
425
- grid = opts.autoidprefix+grid;
426
- }
427
- }
428
- // NULL is interpreted as undefined while null as object
429
- $("#"+this.id).jqGrid('addRowData',grid,getdata,opts.droppos);
430
- }
431
- if(opts.ondrop && $.isFunction(opts.ondrop) ) { opts.ondrop.call(this,ev,ui, getdata); }
432
- }}, opts.drop_opts || {});
433
- },
434
- "onstart" : null,
435
- "onstop" : null,
436
- "beforedrop": null,
437
- "ondrop" : null,
438
- "drop_opts" : {
439
- "activeClass": "ui-state-active",
440
- "hoverClass": "ui-state-hover"
441
- },
442
- "drag_opts" : {
443
- "revert": "invalid",
444
- "helper": "clone",
445
- "cursor": "move",
446
- "appendTo" : "#jqgrid_dnd",
447
- "zIndex": 5000
448
- },
449
- "dropbyname" : false,
450
- "droppos" : "first",
451
- "autoid" : true,
452
- "autoidprefix" : "dnd_"
453
- }, opts || {});
454
-
455
- if(!opts.connectWith) { return; }
456
- opts.connectWith = opts.connectWith.split(",");
457
- opts.connectWith = $.map(opts.connectWith,function(n){return $.trim(n);});
458
- $.data($t,"dnd",opts);
459
-
460
- if($t.p.reccount != "0" && !$t.p.jqgdnd) {
461
- updateDnD();
462
- }
463
- $t.p.jqgdnd = true;
464
- for (var i=0;i<opts.connectWith.length;i++){
465
- var cn =opts.connectWith[i];
466
- $(cn).droppable($.isFunction(opts.drop) ? opts.drop.call($($t),opts) : opts.drop);
467
- }
468
- });
469
- },
470
- gridResize : function(opts) {
471
- return this.each(function(){
472
- var $t = this;
473
- if(!$t.grid || !$.fn.resizable) { return; }
474
- opts = $.extend({}, opts || {});
475
- if(opts.alsoResize ) {
476
- opts._alsoResize_ = opts.alsoResize;
477
- delete opts.alsoResize;
478
- } else {
479
- opts._alsoResize_ = false;
480
- }
481
- if(opts.stop && $.isFunction(opts.stop)) {
482
- opts._stop_ = opts.stop;
483
- delete opts.stop;
484
- } else {
485
- opts._stop_ = false;
486
- }
487
- opts.stop = function (ev, ui) {
488
- $($t).jqGrid('setGridParam',{height:$("#gview_"+$t.p.id+" .ui-jqgrid-bdiv").height()});
489
- $($t).jqGrid('setGridWidth',ui.size.width,opts.shrinkToFit);
490
- if(opts._stop_) { opts._stop_.call($t,ev,ui); }
491
- };
492
- if(opts._alsoResize_) {
493
- var optstest = "{\'#gview_"+$t.p.id+" .ui-jqgrid-bdiv\':true,'" +opts._alsoResize_+"':true}";
494
- opts.alsoResize = eval('('+optstest+')'); // the only way that I found to do this
495
- } else {
496
- opts.alsoResize = $(".ui-jqgrid-bdiv","#gview_"+$t.p.id);
497
- }
498
- delete opts._alsoResize_;
499
- $("#gbox_"+$t.p.id).resizable(opts);
500
- });
501
- }
502
- });
503
- })(jQuery);
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);