JqGrid implements virtual scrolling and merging cells, and jqgrid Cells

Source: Internet
Author: User
Tags jqgrid

JqGrid implements virtual scrolling and merging cells, and jqgrid Cells

Key points:
1. scroll: 1, // virtual scrolling solves the problem of slow loading of big data at one time and solves the problem of Paging
2. function merge (names) // custom function

$ (Function () {// query $ ("# querybtn "). click (function () {var prm ={}; $ ("# querytb td [name]"). each (function (ind, o) {prm [o. name] = $ (o ). val () ;}); if ($ ("# jqgrid "). data ("jqgrid") {// $ ("# jqgrid") initialized "). jqGrid ("setGridParam", {"postData": prm }). trigger ("reloadGrid");} else {$ ("# jqgrid "). jqGrid ({url: 'schandler. ashx? Action = SCResult2 ', caption: "checkresult", datatype: "json", pager: "# pager", postData: prm, height: ($ (window ). height ()-210), colNames: ["rid", "system", "device name", "location", "project", "spot check content ", "checking time", "Checking Result", "result description", "processing method", "processing result", "Checking person", "Checking Unit"], colModel: [{name: "rid", hidden: true, key: true}, {index: "system", name: "system", width: 80}, {index: "device name", name: "device name", width: 80 },{ index: "location", name: "location", width: 80 },{ index: "Project", name: "project", width: 80 },{ index: "spot check content", name: "spot check content", width: 80 },{ index: "spot check time", name: "spot check time", width: 100 },{ index: "spot check result", name: "spot check result", width: 60 },{ index: "result description", name: "result description" },{ index: "processing method", name: "Processing Method" },{ index: "processing result", name: "processing result" },{ index: "Checkpoint reviewer", name: "Checkpoint reviewer" },{ index: "Checkpoint Unit", name: "Checkpoint Unit", hidden: true}], rowNum: 50, gridComplete: function () {merge (["system", "device name", "location", "project ", "Checkpoint content"]) ;}, cmTemplate: {editable: false, sortable: false, width: 80}, scroll: 1, viewrecords: true, gridview: true }). bindKeys (). data ("jqgrid", true) ;}}) ;}); function merge (names) {var trs =$ ("# jqgrid> tbody> tr: gt (0) "); $. each (names, function (ind, name) {var bg = trs. eq (0 ). children ("[aria-describedby = 'jqgrid _" + name + "']"), index = bg. index (), rowsp = 1; trs. slice (1 ). each (function (ind2, tr) {var me = $ (tr ). children ("td "). eq (index); if (bg. text () = me. text () {rowsp ++; me. hide ();} else {bg. attr ("rowspan", rowsp); bg = me; rowsp = 1;} bg. attr ("rowspan", rowsp );});});}

 


After jqgrid cellattr merges cells, the contents in the header are inconsistent.

This problem should not be a problem of code logic. You should go to your jqgrid css folder and change it. I also changed the css file. It is indeed a huge project to find out, you need to search for keywords one by one and try to change the running result. Good luck.
 
How to disable cell merging in EXCEL

Right-click all cells and select cell format ......, Protect the card. Remove both hooks.
Menu tool, protect, and protect worksheets. All the options below are checked

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.