js实现两张table之间的传值

来源:互联网 发布:c语言服务器开发 编辑:程序博客网 时间:2024/05/05 20:29

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>
<HEAD>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
 pageEncoding="ISO-8859-1"%>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META content="IBM Software Development Platform">
<META http-equiv="Content-Style-Type" content="text/css">
<LINK href="theme/Master.css" rel="stylesheet"
 type="text/css">
<TITLE>select table.jsp</TITLE>
</HEAD>
<script language="javascript">

var currentActiveRow
function moveOption(obj,oSelectFrom)
{
 if(currentActiveRow) currentActiveRow.style.backgroundColor="";
 currentActiveRow = obj;
 currentActiveRow.style.backgroundColor="gray";
 currentActiveRow.disabled=true;
 
 var roleName=currentActiveRow.cells[0].innerText;
 var roleType=currentActiveRow.cells[1].innerText;
 
 var selectedObj=document.getElementById(oSelectFrom);
 
 var   rowIndex=selectedObj.childNodes[0].childNodes.length;  
 
 var   objTR=selectedObj.insertRow(rowIndex);
 //alert("message:"+roleName+" "+roleType);
 var cell1=objTR.insertCell();
 var cell2=objTR.insertCell();
 cell1.innerText=roleName;
 cell2.innerText=roleType;
 rowIndex2=parseInt(rowIndex)+parseInt(1);
}

 

function deleteRow(obj)
{
 //var obj=document.getElementById("table1");
 var rowIndex=obj.childNodes[0].childNodes.selectedIndex;
 obj.deleteRow(rowIndex-parseInt(1));
}

</script>
<BODY>
<table width="100%" border="1" cellspacing="0" cellpadding="0" height="55" bordercolor="#eaeaea">
              <tr>
                <td height="250" valign="top">
                  <!--INSERT REPORT TREE-->
                  <table width="100%" border="0" cellspacing="0" cellpadding="0" disabled>
                    <tr height="18">
                      <td width="18%" >&nbsp;Available Views</td>
                      <td width="28%" ><div align="right">
        Search <input size=10 >
                              &nbsp;<button 'AvlRptGrp', true,'#ffff00');" type="submit">Find</button></div>
      
       </td>
                      <td width="54%">&nbsp;Selected Views</td>
                    </tr>
                  </table>
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td valign="top" width="46%">
              <div style="width=100%; height:230; overflow:auto">      
      <TABLE width="100%" height="20" border="1">
          <tr table2');"><th>View</th><th>Type</th></tr>
          <tr table2');"><td>werw1</td><td>dfs</td></tr>
          <tr table2');"><td>werw2</td><td>dfs</td></tr>
          <tr table2');"><td>werw3</td><td>dfs</td></tr>
          <tr table2');"><td>werw4</td><td>dfs</td></tr>
          <tr table2');"><td>werw5</td><td>dfs</td></tr>
          <tr table2');"><td>werw6</td><td>dfs</td></tr>
          <tr table2');"><td>werw7</td><td>dfs</td></tr>
          <tr table2');"><td>werw8</td><td>dfs</td></tr>
          <tr table2');"><td>werw9</td><td>dfs</td></tr>
          <tr table2');"><td>werw0</td><td>dfs</td></tr>      
      </TABLE>
      </div>
       </td>
                      <td valign="top" width="54%">
       <%--
<table width="100%" border="1" cellspacing="0" cellpadding="0" height="217" bordercolor="#eaeaea">
                          <tr>
                            <td>Selected reports table here </td>
                          </tr>
                        </table>
      --%>
      <div style="width=100%; height:230; overflow:auto">
      <TABLE width="100%" height="20" border="1">
          <tr><th>View</th><th>Type</th></tr>   
      </TABLE>
      </div>
      
                      </td>
                    </tr>
     <tr>
       <td>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td valign="top" width="3%"><img src='<%= response.encodeURL("/images/info.gif") %>' width="18" height="15"></td>
                            <td valign="top" width="97%">Doubleclick
                              a report to add it to Selected Report List.
                            </td>
                          </tr>
                        </table>
                        <%--   <p><button AvlRptGrp','SelRptGrp');"></button></p>--%>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="1%"><img src='<%= response.encodeURL("/images/transparent.gif") %>' width="2" height="1"></td>
                            <td width=""><button AvlRptGrp','SelRptGrp');" >Add All >></button></td>
                             
                            <td  ><button table2','replace',true,false);">Add Selected ></button></td>
                             
                          </tr>
                        </table>
                     
                      </td>
       <td align="right" valign="top">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td valign="top" width="7%">&nbsp;&nbsp;<img src='<%= response.encodeURL("/images/info.gif") %>' width="18" height="15"></td>
                            <td valign="top" width="93%">Doubleclick
                              a report to remove report from Selected Report List.
                            </td>
                          </tr>
                        </table>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="6%"> <img src='<%= response.encodeURL("/images/transparent.gif") %>' width="10">
                            </td>

                            <td  ><button SelRptGrp1, 'AvlRptGrp1', 'replace',true,false);" type="submit" > < Remove Selected</button></td>
                           
                            <td width=""><button SelRptGrp','AvlRptGrp');" > << Remove All</button></td>
                          </tr>
                        </table>
                </td>
     </tr>
                    <tr>
                      <td height="0" valign="top" width="46%">&nbsp; </td>
                      <td height="0" valign="top" width="54%">&nbsp; </td>
                    </tr>
    
                  </table>
</BODY>
</HTML>

 
原创粉丝点击