zoukankan      html  css  js  c++  java
  • checkbox 全选的使用

         1

    for(int i=0;i<this.dgWaitDraw.Items.Count;i++)
        {
        
         if((this.dgWaitDraw.Items[i].Cells[8].FindControl("cbDraw") as CheckBox).Checked)
         {
          partID=this.dgWaitDraw.Items[i].Cells[0].Text.Trim().ToString();
          getId=this.Request["getID"].ToString();
          iFactQty=int.Parse(this.dgWaitDraw.Items[i].Cells[4].Text.Trim().ToString());
          err=BLL.BLL.zh.ProjectOprate.updateDrawByPartIDAndDrawID(partID,getId,iFactQty,db);
          if(err!=0)
          {
           MessageBox.Show(this.Page,"领料失败!");
           tran.Rollback();
           return;
          }
         }
        }

     

    2

    <HeaderTemplate>
    <INPUT id=chkAll onclick="chk(this,'dgWaitDraw')" type=checkbox>全选
    </HeaderTemplate>

    <ItemTemplate>
    <asp:CheckBox id=cbDraw runat="server"></asp:CheckBox>
    </ItemTemplate>
    </asp:TemplateColumn>

    3      <script language="javascript">
       function printpage(myDiv)
       {
        //var strResult=window.confirm("确认用Word打印吗?");
        var strResult=true;
        if(strResult)
        {
         
         var newstr = document.all.item(myDiv).innerHTML;
         var oldstr = document.body.innerHTML;
         document.body.innerHTML = newstr;
         window.print();
         document.body.innerHTML = oldstr;
        }
       }
       
      
      function chk(chk,id)
      {
       var oEvent = document.all(id);
       var chks = oEvent.getElementsByTagName("INPUT");
       for(var i=0; i<chks.length; i++)
       {
        if(chks[i].type=="checkbox")
        chks[i].checked=chk.checked;
       }
      }
      </script>
              

  • 相关阅读:
    android升级gradle到3.4.1
    django1.10.3下admin后台管理老是显示object
    django 1.10.3 admin后台管理设置显示中文
    Linux查看版本信息
    Centos下查看mysql的版本
    Linux centos6.7网卡配置
    Linux centos 防火墙篇
    MYSQL ERROR 1045 (28000) Access denied for user (using password YES)问题的解决
    centos7中的网卡名称相关知识
    redis编译和安装出现错误
  • 原文地址:https://www.cnblogs.com/csj007523/p/1250558.html
Copyright © 2011-2022 走看看