zoukankan      html  css  js  c++  java
  • 行改变色

     protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
            {
                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    string key = this.GridView1.DataKeys[e.Row.RowIndex].Value.ToString();
                    e.Row.Attributes.Add("onmouseover", "if(this!=prevselitem){this.style.backgroundColor='#Efefef'};this.style.cursor='hand';");//当鼠标停留时更改背景色
                    e.Row.Attributes.Add("onmouseout", "if(this!=prevselitem){this.style.backgroundColor='#ffffff'}");//当鼠标移开时还原背景色
                    e.Row.Attributes.Add("onclick", e.Row.ClientID.ToString() + ".checked=true;selectx(this);setvalue('" + key + " ')");
                    // e.Row.Attributes.Add("onclick", "alert('"  + key + " ')");
                   
                }
            }

     <script type="text/javascript">
          var prevselitem=null;
           function selectx(row)
          {
                  if(prevselitem!=null)
                 {
                      prevselitem.style.backgroundColor='#ffffff';
                   }
                  row.style.backgroundColor='PeachPuff';
                  prevselitem=row;
                 
          }
          function setvalue(obj)
          {
          document.getElementById("Hidden1").value=obj;
          document.getElementById("dd").innerHTML=obj;
          alert(obj);
           document.all('Button1').click();
     
          }
      </script>

  • 相关阅读:
    前后端分离djangorestframework—— 在线视频平台接入第三方加密防盗录视频
    ORACLE ASMLIB
    1519484
    How to deploy Oracle 12c Release 2 Grid and RAC Database on RHEL 7.x
    2647673
    Installation of SAP on RAC with Oracle ASM(转)
    redhat7.2下VNC没法显示图像
    Oracle12C
    (转)linux 内存管理——内核的shmall 和shmmax 参数
    ora121 tips
  • 原文地址:https://www.cnblogs.com/IsNull/p/1718265.html
Copyright © 2011-2022 走看看