【发布时间】:2016-02-26 09:39:02
【问题描述】:
我正在尝试使 jqgrid 列选择器弹出窗口可拖动到屏幕的任何位置。
因此我尝试将jquery.jqgrid.js 更改为:
columnChooser: function (opts) {
var self = this;
if ($("#colchooser_" + $.jgrid.jqID(self[0].p.id)).length) { return; }
var selector = $('<div id="colchooser_' + self[0].p.id + '" style="position:relative;overflow:hidden"><div><select multiple="multiple"></select></div></div>');
var select = $('select', selector);
function insert(perm, i, v) {
if (i >= 0) {
var a = perm.slice();
var b = a.splice(i, Math.max(perm.length - i, i));
if (i > perm.length) { i = perm.length; }
a[i] = v;
return a.concat(b);
}
}
opts = $.extend({
"width": 'auto',
"height": 260,
"classname": null,
"done": function (perm) { if (perm) { self.jqGrid("remapColumns", perm, true); } },
/* msel is either the name of a ui widget class that
extends a multiselect, or a function that supports
creating a multiselect object (with no argument,
or when passed an object), and destroying it (when
passed the string "destroy"). */
"msel": "multiselect",
/* "msel_opts" : {}, */
/* dlog is either the name of a ui widget class that
behaves in a dialog-like way, or a function, that
supports creating a dialog (when passed dlog_opts)
or destroying a dialog (when passed the string
"destroy")
*/
"dlog": "dialog",
"dialog_opts": {
"minWidth": 550
},
"draggable": function (IsDraggable) {
if (IsDraggable) {
this.draggable();
}
},
....
....
....
....
....
}
我的代码位于上述函数的最后一个属性draggable。
即我创建了一个如下所示的可拖动属性:
"draggable": function (IsDraggable) {
if (IsDraggable) {
this.draggable();
}
但是我的列选择器的弹出窗口无法拖动。
我在这里感到震惊。
我想将jqgrid 中的列选择器移动到屏幕的任意位置。
【问题讨论】:
标签: javascript jquery jquery-ui jqgrid