user2009877 user2009877 - 1 year ago 80
jQuery Question

What is p.nv propertty of column in dragEnd() jqgrid?

I am curious what is p.nv property in jqgrid columns. This is being using inside

function in jqgrid.

dragEnd: function() { = "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;
p.colModel[idx].width = nw;
this.headers[idx].width = nw;
this.headers[idx] = nw + "px";
this.cols[idx].style.width = nw+"px";
if(this.footers.length>0) {this.footers[idx].style.width = nw+"px";}
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] = 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;


It seems that you included the first part of the code dragEnd from some old version of jqGrid. At least the code of dragEnd from version 4.7 looks the same.

The parameter nv (p.nv) will be initialized to 0 initially (see 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) before dragStart be started.

By the way I rewrote the code in free jqGrid to allow to move separater between the columns outer of the grid. It's very helpful during resizing of the last column of the grid.