Jqgrid v5.0.1 When the number of columns setgridwidth the table header and the content is not aligned

Source: Internet
Author: User
Tags jqgrid

After testing, the Setgridwidth method is not the width of the first line, but the width of the first row. So add the width of the first line.

The last few lines of code change the width of the last column, but it is not used. The scroll bar is outside the table.

Local 4263 lines Start

$.each ($t. P.colmodel, function (i) {if (This.hidden = = = False &&!this.fixed) {cw = THIS.WIDTHORG;CW = Math.Round ( aw*cw/($t. P.TBLWIDTH-BRD*VC-GW)); if (CW < 0) {return;} This.width =cw;initwidth + = CW; $t. GRID.HEADERS[I].WIDTH=CW; $t. grid.headers[i].el.style.width = cw + "px"; $ ($ T.GRID.HDIV). Find ('. Jqg-first-row-header th:eq (' + i + ') '). CSS ({WIDTH:CW + "px"}); when the//mod by XSS window is scaled, the pair is not aligned if ($ T.p.footerrow) {$t. grid.footers[i].style.width = cw+ "px";} if (CLE) {$t. grid.cols[i].style.width = cw+ "px";} LVC = i;}}); if (!LVC) {return;} CR =0;if (HS) {if (nwidth-gw-(INITWIDTH+BRD*VC)!== SCW) {cr = nwidth-gw-(INITWIDTH+BRD*VC)-SCW;}} else if (Math.Abs ( nwidth-gw-(INITWIDTH+BRD*VC))!== 1) {cr = nwidth-gw-(INITWIDTH+BRD*VC);} $t. p.colmodel[lvc].width + = CR; $t. p.tblwidth = Initwidth+cr+brd*vc+gw;if ($t. P.tblwidth > Nwidth) {var delta = $ T.p.tblwidth-parseint (nwidth,10); $t. p.tblwidth = NWIDTH;CW = $t. P.colmodel[lvc].width = $t. P.COLMODEL[LVC]. Width-delta;} else {cw= $t. p.colmodel[lvc].width;}    MoD by xss//$t. grid.headers[lvc].width = cw;//$t. Grid.headers[lvc].el.style.width = cw + "px";//$ ($t. grid.hdiv). Find ('. Jqg-first-row-header th:eq (' + LVC + ') '). CSS ({WIDTH:CW + "px"});//mod by xss//if (CLE) {$t. Grid.cols[lvc].style.wid th = cw+ "px"; }if ($t. P.footerrow) {//$t. Grid.footers[lvc].style.width = cw+ "px";}

  

Jqgrid v5.0.1 When the number of columns setgridwidth the table header and the content is not aligned

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.