dragEnd() jqgrid 中列的 p.nv 属性是什么?
What is p.nv propertty of column in dragEnd() jqgrid?
我很好奇 jqgrid 列中的 p.nv 属性 是什么。这是在 jqgrid 中使用内部 dragEnd()
函数。
dragEnd: function() {
this.hDiv.style.cursor = "default";
if(this.resizing) {
var idx = this.resizing.idx,
nw = this.headers[idx].newWidth || this.headers[idx].width;
nw = parseInt(nw,10);
this.resizing = false;
$("#rs_m"+$.jgrid.jqID(p.id)).css("display","none");
p.colModel[idx].width = nw;
this.headers[idx].width = nw;
this.headers[idx].el.style.width = nw + "px";
this.cols[idx].style.width = nw+"px";
if(this.footers.length>0) {this.footers[idx].style.width = nw+"px";}
if(p.forceFit===true){
nw = this.headers[idx+p.nv].newWidth || this.headers[idx+p.nv].width;
this.headers[idx+p.nv].width = nw;
this.headers[idx+p.nv].el.style.width = nw + "px";
this.cols[idx+p.nv].style.width = nw+"px";
if(this.footers.length>0) {this.footers[idx+p.nv].style.width = nw+"px";}
p.colModel[idx+p.nv].width = nw;
}
您似乎包含了来自某些旧版本 jqGrid 的代码 dragEnd
的第一部分。至少从 4.7 版开始 dragEnd
的代码看起来是一样的。
参数nv
(p.nv) 在dragStart
开始之前将初始化为0 (参见here) and it will be used inside of dragMove
(see here) and dragEnd
(see here) only if the option forceFit: true
is set. In the case the option nv
will be set to the index in colModel
of the next visible column (nv
come from the next visible) after the resizing column inside of mousedown
event handler (see here)。
顺便说一句,我重写了 free jqGrid 中的代码,以允许在 网格外部 列之间移动分隔符。这在调整网格最后一列的大小时非常有用。
我很好奇 jqgrid 列中的 p.nv 属性 是什么。这是在 jqgrid 中使用内部 dragEnd()
函数。
dragEnd: function() {
this.hDiv.style.cursor = "default";
if(this.resizing) {
var idx = this.resizing.idx,
nw = this.headers[idx].newWidth || this.headers[idx].width;
nw = parseInt(nw,10);
this.resizing = false;
$("#rs_m"+$.jgrid.jqID(p.id)).css("display","none");
p.colModel[idx].width = nw;
this.headers[idx].width = nw;
this.headers[idx].el.style.width = nw + "px";
this.cols[idx].style.width = nw+"px";
if(this.footers.length>0) {this.footers[idx].style.width = nw+"px";}
if(p.forceFit===true){
nw = this.headers[idx+p.nv].newWidth || this.headers[idx+p.nv].width;
this.headers[idx+p.nv].width = nw;
this.headers[idx+p.nv].el.style.width = nw + "px";
this.cols[idx+p.nv].style.width = nw+"px";
if(this.footers.length>0) {this.footers[idx+p.nv].style.width = nw+"px";}
p.colModel[idx+p.nv].width = nw;
}
您似乎包含了来自某些旧版本 jqGrid 的代码 dragEnd
的第一部分。至少从 4.7 版开始 dragEnd
的代码看起来是一样的。
参数nv
(p.nv) 在dragStart
开始之前将初始化为0 (参见here) and it will be used inside of dragMove
(see here) and dragEnd
(see here) only if the option forceFit: true
is set. In the case the option nv
will be set to the index in colModel
of the next visible column (nv
come from the next visible) after the resizing column inside of mousedown
event handler (see here)。
顺便说一句,我重写了 free jqGrid 中的代码,以允许在 网格外部 列之间移动分隔符。这在调整网格最后一列的大小时非常有用。