Customize the table table, get the content, and pass the URL of the popup box, get the results displayed in the popup box, and load the totals

Source: Internet
Author: User

Table table, Selection box

form id= "EditForm1" ><Tableclass= "Table_form">        <TD>Economic nature:</TD>           <TD>                <inputwidth= "Max"type= "text"ID= "nature_id"readonly onclick= "show_nature ()">                <inputtype= "hidden"name= "Nature_name">            </TD>        </TR>        <TR><TDcolspan= "3">Please select a statistic type:</TD></TR>        <TR>            <TDAlign= "Right">                <inputtype= "Radio"class=""name= "Rblviewstyle"value= "1"checked= "Checked"class= "Mini-textboxlist">full caliber</TD>            <TDAlign= "Right">                <inputtype= "Radio"class=""name= "Rblviewstyle"value= "2"class= "Mini-textboxlist">District-Level partitioning</TD>        </TR>        <TR>            <TDcolspan= "3"Align= "Center">                <aclass= "Btn_color_1"ID= "BtnSaveBack1"onclick= "Chaxun (0);"><Iclass= "fa Fa-save"></I>Inquire</a>            </TD>        </TR>    </Table></form>

Pop-up box showing the results

<DivID= "EditWindow1"class= "Mini-window"title= "Tax statistics of the state tax department"style= "width:1400px; height:600px;"ShowModal= "true"allowresize= "true"Allowdrag= "true">    <DivID= "Grid"class= "Mini-datagrid"style= "width:100%; height:100%; border:0;"DataField= "Rows"URL= "${ctx}/taxpaytaxextotal/gdhz_dept"AutoLoad= "false"allowresize= "false"SortField= "ID"SortOrder= "ASC"pagesize= "+"allowalternating= "true"MultiSelect= "true"onload= "OnLoad">    </Div></Div>

Click on the query to enter the Chaxun (0) method

get the contents of the input boxvarnature_name=$ (' #nature_id ').Val (); Rblviewstyle= ($ ("[name= ' Rblviewstyle ']:checked").Val ());//put the data in the _searchdatavar_searchdata ={};_searchdata= $.extend (_searchdata, Mini.decode ("{' Nature_name ': '" + Nature_name + "'}")); _searchdata= $.extend (_searchdata, Mini.decode ("{' Rblviewstyle ': '" + Rblviewstyle + "'}"));//Load the popup box firstEditWindow1.Show (); load the contents of the table in the popup grid.set ({columns:[{Field: "Town", Width:140,align: "Center", Headeralign: "Center", Allowsort:true,Header: "Owned Town Office"},        ]});//then execute the URL in the popup grid and pass the data to the background to get the result and give the content to the popup boxGrid.load (_searchdata);

the pop-up box has onload= " OnLoad " Properties, loading OnLoad () method, Add a new row for totals

function OnLoad (e) {var index=grid.getdata (). length; var row= {"Town": "Total", "ZCDJLX": "", "Money_all": ""};//Add a new rowgrid.addrow (row, index);//for index rows, from 1th column placeholder (consolidated) 1 rows 2 columnsvar marges =[{rowindex:index, columnindex:1, Rowspan:1, Colspan:2},    ]; Grid.mergecells (marges);//to mergevar grids=E.sender; var money_all=0; var length=grids.data.length;//add to each line of content     for(var i = 0; I <length; i++) {Money_all=money_all+ (Grids.data[i]. Money_all = = ""? 0: Parsefloat (Grids.data[i].    Money_all)); }//Modify the rowGrid.updaterow (Row, {"Money_all"): Money_all}); }

Customize the table table, get the content, and pass the URL of the popup box, get the results displayed in the popup box, and load the totals

Related Article

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.