Webform+easyui-based business management system formation Tour--paramquerygrid row, column merge (Ⅸ)

Source: Internet
Author: User

The Webform+easyui-based business management system formation Tour-construction Plan Inquiry (Ⅷ), mainly introduces the data drilling through the report tool, obtains the construction plan detail information.

Let's take a look at Paramquerygrid. "Row merge" and "column merge"

One, "column merge" effect

Take the numbering configuration interface as an example, as shown in.

Set up a table column merge with the following code.

1 /** Set table column merge2 Colmodel: Column3 , Startnumber: Start column4 , NumberOfColumns: Starting from the Start column, merging the number of columns5 , TitleText: Merge column headings6 **/7 function Setpqgridgroupheaders (Colmodel, Startnumber, NumberOfColumns, TitleText) {8     varcol = [], Spancols = [];9     if(Startnumber + numberofcolumns >colmodel.length) {Ten         return NULL; One     } A      for(vari =0; i < colmodel.length; i++) { -         if(i = =Startnumber) { -             varIcol =i; the             varNclos = {Dataindx:icol, title:titletext, Width: -, align:'Center' }; -             varCvisiblecolumns =0; -              for(varj =0; J < NumberOfColumns && (i + J < colmodel.length); J + +) { -                 if(!colmodel[icol +J].hidden) { +Spancols.push (Colmodel[icol +j]); -cvisiblecolumns++; +                 } A             } atNclos.colmodel =Spancols; - Col.push (Nclos); -             if(Cvisiblecolumns >0) { -i + =Cvisiblecolumns; -             } -         } in         if(I <colmodel.length) { - Col.push (Colmodel[i]); to         } +     } -     returnCol; the}

Setpqgridgroupheaders (ColM, 1, 2, ' basic Information ');

With this method, we can merge column ordinals starting with 1, and merge 2 columns, column headings: ' Basic information '

Second, "row merge" effect

Take the numbering configuration interface as an example, as shown in.

Set up a table row merge with the following code.

1 /** Set table row Merge2 obj_id: Table ID3 **/4 function Merge (obj_id) {5     if($ (obj_id)) {6         varData = $ (obj_id). Pqgrid ("option","Datamodel.data");7         varTRS = $ (obj_id). Find ("Tr.pq-grid-row");8          for(vari = data.length; i >0; i--) {9              for(varj = trs.length; J >0; j--) {Ten                 varBefore = $ (Trs[j-1]). Find ("Td.pq-grid-cell:nth-child ("+ i +")"); One                 varEnd = $ (trs[j]). Find ("Td.pq-grid-cell:nth-child ("+ i +")"); A                 if(End.text () = =Before.text ()) { -                     varRowSpan = (End.attr ("rowspan") ||1); -Before.attr ("rowspan", parseint (RowSpan) +1); the End.remove (); -                 } -             } -         } +     } -}
Third, "Row, column merge" effect

Take the numbering configuration interface as an example, as shown in.

When exporting Excel through Npoi, the row, column merge Excel format is not implemented, there is a small partner who knows how to implement, the message informs, THX.

Webform+easyui-based business management system formation Tour--paramquerygrid row, column merge (Ⅸ)

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.