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 (Ⅸ)