waysun一路阳光

不轻易服输,不轻言放弃.--心是梦的舞台,心有多大,舞台有多大。踏踏实实做事,认认真真做人。

  BlogJava :: 首页 :: 新随笔 :: 联系 ::  :: 管理 ::
  167 随笔 :: 1 文章 :: 64 评论 :: 0 Trackbacks
1.  x.jsp


function open(form)
{
        var apply_id=form.flag.value;
        var srcFile = "/uniframework/configuration.action?actName=applyToDistribut&flag="+apply_id;
        var winFeatures = "dialogWidth=850px;dialogHeight=550px;status=no;help=no;";
        var seleItemValue='';
        var checkbox = form.checkbox;
        if(checkbox){
       
        if(checkbox.length)
        {
         for(var i=0;i<checkbox.length;i++)
         {
          if(i==0)seleItemValue = form.checkbox[i].value;
          else
          seleItemValue+=","+form.checkbox[i].value;
         }
        }else
        {
         seleItemValue = form.checkbox.value;
        }
        }

        var obj = form1;
        var ret = window.showModalDialog(srcFile, seleItemValue, winFeatures);

        if(ret!=undefined){
         addCTItemToTable(ret);
        }
       
}
function addCTItemToTable(data)
{
 var tableobj = document.getElementById("CTTable");
 var appli_id="";
 if (tableobj != null)
 {
     for(var k=0;k<data.length;k++)
        {
            var st=data[k];
            appli_id=st[7];
            var newRow = tableobj.insertRow(tableobj.rows.length);
   c1 = newRow.insertCell(0);
   c1.innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp;<input type=checkbox name=checkbox checked class=checkbox1 value='"+st[0]+"'>&nbsp;&nbsp;";
   c2 = newRow.insertCell(1);
   c2.innerHTML = '<div align=\"center\">' + st[1] + '</div>';
   c3 = newRow.insertCell(2);
   c3.innerHTML = '<div align=\"center\">'+st[2]+'</div>';
   c4 = newRow.insertCell(3);
   c4.innerHTML = '<div align=\"center\">'+st[3]+'</div>';
   c5 = newRow.insertCell(4);
   c5.innerHTML = '<div align=\"center\">'+st[4]+'</div>';
   c6 = newRow.insertCell(5);
   c6.innerHTML = '<div align=\"center\">'+st[5]+'</div>';
   c7 = newRow.insertCell(6);
   c7.innerHTML = '<div align=\"center\">'+st[6]+'</div>'
        }
    }
}

2.y.jsp

function addCTItemReturnT(form)
{

    applyid=form.info3.value;
 var check= form.checkbox;
 var arr=new Array();
    var string="";
    var index=0;
 if(check.length)
 {
  for(var i=0;i<check.length;i++)
  {
       var checkval = check[i];
     
             if(checkval.checked)
             {
                   var row = checkval.parentElement.parentElement;
                   var data=[];
                   data[0] = checkval.value;//产品型号;
                   data[1] = form.ASSET_CODE[row.rowIndex -1].value;//资产编码
       data[2] = form.PROJECTNO[row.rowIndex -1].value;//项目编号
       data[3] = form.CI_NAME[row.rowIndex -1].value;// 配置项名
       data[4] = form.RESPONSIBILITY[row.rowIndex -1].value;//责任人
       data[5] = form.KEEPER[row.rowIndex -1].value;//使用人
       data[6] = form.PRODUCT_MODLE[row.rowIndex -1].value;//产品型号
       data[7] = applyid;//产品型号
                   arr[index]=data;
                   index++;
             }
            
  }
 }
    for(var k=0;k<arr.length;k++)
    {
          var st=arr[k];
          //alert("---"+st[0]+"::"+st[3]);
    }
 window.returnValue=arr;
 window.close();
}
posted on 2008-08-05 15:02 weesun一米阳光 阅读(210) 评论(0)  编辑  收藏 所属分类: AJAX总结备用

只有注册用户登录后才能发表评论。


网站导航: