grid.jqueryui.js 19 KB

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