zoukankan      html  css  js  c++  java
  • GridView的双击等几个事件

    【前台】
    <script language="javascript">        
            function dbclickevent(d)
            {
                  window.alert(
    "事件类型: doubleclidk  作用对象: " + d);            
            }
            function clickevent(d)
            {
                  window.alert(
    "事件类型: onclick  作用对象: " + d);            
            }
            function gridviewitemkeydownevent(d)
            {
                  window.alert(
    "事件类型: gridviewitemkeydownevent  作用对象: " + d);       
            }
            function keydownevent()
            {
                   
    ifevent.altkey && event.keycode > 48 && event.keycode < 54 )            
                   {                
                          window.alert(
    "事件类型: formkeydownevent  选中记录数: " + ( parseint(event.keycode) - 48 )); 
                   }                      
            }           
    </script>
     
    【后台】
    if( e.row.rowtype == datacontrolrowtype.datarow)
    {
             
    //鼠标移动到每项时颜色交替效果
             e.row.attributes.add("onmouseout""this.style.backgroundcolor=white;this.style.color=#003399");
             e.row.attributes.add(
    "onmouseover""this.style.backgroundcolor=#6699ff;this.style.color=#8c4510");

             
    //单击/双击 事件
             
    e.row.attributes.add("ondblclick", "dbclickevent(" + e.row.cells[1].text + ")");
             e.row.attributes.add("onclick""clickevent(" + e.row.cells[1].text + ")");

             
    e.row.attributes.add("onkeydown", "gridviewitemkeydownevent(" + e.row.cells[1].text + ")"); 

             
    //设置悬浮鼠标指针形状为"小手"
             e.row.attributes["style"= "cursor:hand";
             
    }
  • 相关阅读:
    动态修改 dom 元素的伪类样式
    visual studio 2013 触发挂起事件
    windows phone 切换多语言时,商店标题显示错误的问题
    01、Windows Store APP 设置页面横竖屏的方法
    HTTPS和HTTP的概念和区别
    前端要知道的浏览器原理
    HTTP协议详解
    angular4路由设置笔记
    js正则及常用方法函数总结
    史上最全常用正则表达式大全
  • 原文地址:https://www.cnblogs.com/fhuafeng/p/1772340.html
Copyright © 2011-2022 走看看